Form List problem with Javascript

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Form List problem with Javascript

    I have a list that is being generated dynamically from my MS SQL
    database. It basically lists a series of events in the database as the
    labels and has there ID numbers as the value.

    I want it so that when an event is clicked that a eventdetail page will be
    opened in a seperate frame, passing the selected event's ID number through
    the URL.

    I think I need to use Javascript, but when I use the behavoir function in
    Dreamweaver it does nothing.

    Any suggestions?
    my code is below:
    (My page is in ASP VBscript)

    <select name="select" size="20" class="dropdown" id="el01"
    onChange="MM_goToURL('tdetails','tour_details2.asp ?tid=<%=(rs_tourdates.Fields.Item("tourid").Value) %>">
    <%
    While (NOT rs_tourdates.EOF)
    %>
    <option value="<%=(rs_tourdates.Fields.Item("tourid").Valu e)%>"><%=
    DoDateTime((rs_tourdates.Fields.Item("tourdate").V alue), 2, 2057) %> -
    <%=(rs_tourdates.Fields.Item("tourtitle").Value) %> -
    <%=(rs_tourdates.Fields.Item("tourlocation").Value )%></option>
    <%
    rs_tourdates.MoveNext()
    Wend
    If (rs_tourdates.CursorType > 0) Then
    rs_tourdates.MoveFirst
    Else
    rs_tourdates.Requery
    End If
    %>
    </select>


    And above in the code, Dreamweaver generated this Javascript:
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_goToURL() { //v3.0
    var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
    for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    }
    //-->
    </script>
    Timothy Robertson Guest

  2. Similar Questions and Discussions

    1. How do I create form fields like buttons,list box and associate JavaScript with thosefields?
      IS it possible to create form fields like buttons, list box using PDFL SDK? How do I associate JavaScript with these form fields and also on document...
    2. Searching a column containing a list against a form list
      I have a form that allows users to select multiple items from a list. form.hobbies = 1,5,3,6,8,2 (from a table pullup) I want to be able to...
    3. JavaScript: html list items within list items?
      Hi, I've seen how to implement a JavaScript to change the CSS class of every other list item in an unordered list, but, being new to JavaScript,...
    4. List Menu, Javascript and Form Submit
      I am using a list menu to perform two tasks. First, it toggles a show/hide area based on the selected value using javascript. The I use an insert...
    5. Problem: Javascript & PHP form with HTML_QuickForm
      Hi, I have a problem with a form using the PHP PEAR HTML_QuickForm package & javascript: I want to record the content of my form into a mySQL...
  3. #2

    Default Re: Form List problem with Javascript

    I discovered that if I took the method="POST" action="" out of the form tags
    then the javascript worked but only in safari, not in explorer. I double
    checked and explorer does have javascript enabled, does anyone know where
    the problem may lye?


    On 4/5/05 4:29 PM, in article robertson-0504051629470001@localhost, "Timothy
    Robertson" <robertson@m-2-design.com> wrote:
    > I have a list that is being generated dynamically from my MS SQL
    > database. It basically lists a series of events in the database as the
    > labels and has there ID numbers as the value.
    >
    > I want it so that when an event is clicked that a eventdetail page will be
    > opened in a seperate frame, passing the selected event's ID number through
    > the URL.
    >
    > I think I need to use Javascript, but when I use the behavoir function in
    > Dreamweaver it does nothing.
    >
    > Any suggestions?
    > my code is below:
    > (My page is in ASP VBscript)
    >
    > <select name="select" size="20" class="dropdown" id="el01"
    > onChange="MM_goToURL('tdetails','tour_details2.asp ?tid=<%=(rs_tourdates.Fields
    > .Item("tourid").Value)%>">
    > <%
    > While (NOT rs_tourdates.EOF)
    > %>
    > <option value="<%=(rs_tourdates.Fields.Item("tourid").Valu e)%>"><%=
    > DoDateTime((rs_tourdates.Fields.Item("tourdate").V alue), 2, 2057) %> -
    > <%=(rs_tourdates.Fields.Item("tourtitle").Value) %> -
    > <%=(rs_tourdates.Fields.Item("tourlocation").Value )%></option>
    > <%
    > rs_tourdates.MoveNext()
    > Wend
    > If (rs_tourdates.CursorType > 0) Then
    > rs_tourdates.MoveFirst
    > Else
    > rs_tourdates.Requery
    > End If
    > %>
    > </select>
    >
    >
    > And above in the code, Dreamweaver generated this Javascript:
    > <script language="JavaScript" type="text/JavaScript">
    > <!--
    > function MM_goToURL() { //v3.0
    > var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
    > for (i=0; i<(args.length-1); i+=2)
    > eval(args[i]+".location='"+args[i+1]+"'");
    > }
    > //-->
    > </script>
    Timothy Robertson Guest

Posting Permissions

  • You may not post new threads
  • You may 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