Professional Web Applications Themes

jump menu initial value - Macromedia Dreamweaver

Is it possible for a jump menu to have an initial value? I want one that jumps to the same page (plus a url param) if a menu item is selected, and keeps the selection you make as the initial value. There are buttons on the page to go to other pages and I want the jump menu on additional pages to keep this initial selection as well. Can this be done using the url param? or the menu index value?? or something??? monkey...

  1. #1

    Default jump menu initial value

    Is it possible for a jump menu to have an initial value?

    I want one that jumps to the same page (plus a url param) if a menu item is selected, and keeps the selection you make as the initial value. There are buttons on the page to go to other pages and I want the jump menu on additional pages to keep this initial selection as well.

    Can this be done using the url param? or the menu index value?? or something???

    monkey



    boxhead Guest

  2. #2

    Default Re: jump menu initial value

    I thjink it can be done, but you may need to rephrase your question.
    Mick

    "\"boxhead\" webforumsuser"macromedia.com wrote:
     

    mick_white Guest

  3. #3

    Default Re: jump menu initial value

    UPDATE!!

    I have got everything to work except for the initail value. When the page reloads a url param is created called 'selectval' which is set ti the index val of the menu item selected ie 2 for the 3rd option.

    The problem is, I cant get the jump menu to set itself to this value. I have tried putting the following:

    <select index="<%=(Request.QueryString("selectval"))%>">
    <select title="<%=(Request.QueryString("selectval"))%>">

    but neither work. Any idea how I do this?

    monkey




    boxhead Guest

  4. #4

    Default Re: jump menu initial value


    I don't know how to do it in asp, but in javascript you just set its selected property to true.

    <select name="g" onchange="location=location+'?'+this.selectedIndex ">
    <option selected>Select One</option>
    <option value="r">red</option>
    <option value="w">white</option>
    <option value="b">blue</option>
    </select>
    :
    <script>

    function setSelect(){if(location.search) eval("doent.forms[0].g.options["+location.search.substring(1)+"].selected=true"}
    </script>
    <body onload="setSelect()">
    Mick



    "\"boxhead\" webforumsuser"macromedia.com wrote:
     

    mick_white Guest

  5. #5

    Default Re: jump menu initial value

    Mick

    Cheers! I got it to work a different way:

    <select name="locdd" tabindex="<%=(Request.QueryString("selectval"))%>" onChange="MM_jumpMenu('parent',this)">

    <option value="AM" <%If (Not isNull((Request.QueryString("selectval")))) Then If ("AM" = CStr((Request.QueryString("stationval")))) Then Response.Write("SELECTED") : Response.Write("")%>>Amesbury</option>

    This works well as i only need one url param, which is the one I need for recordset filtering as well, BUT it involves A LOT of coding (each option has the above code!).

    Just one question, why is your If statement not in curly braces? ie

    if(location.search) {
    eval("doent.forms[0].locdd.options["+location.search.substring(1)"].selected=true")

    }

    I thought this always had to be done?

    Thanks for all your help

    monkey




    boxhead Guest

  6. #6

    Default Re: jump menu initial value



    "\"boxhead\" webforumsuser"macromedia.com wrote:
     

    If the statements are on the same line , and providing the "if" statement is not followed by a semi colon, the curly braces are not required.
    Having said this, I'd recommend that you always use curly braces.

    if(location.search) eval("doent.forms[0].locdd.options["+location.search.substring(1)+"].selected=true")//OK


    if(location.search)
    eval("doent.forms[0].locdd.options["+location.search.substring(1)+"].selected=true")// not OK

    Mick
     

    mick_white Guest

Similar Threads

  1. Jump Menu
    By mikehins in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: September 26th, 06:35 PM
  2. jump menu help
    By mamakin in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 1
    Last Post: July 8th, 02:04 PM
  3. Help On Jump Menu's Please
    By kevryan in forum Macromedia Dynamic HTML
    Replies: 3
    Last Post: March 7th, 09:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139