Results 1 to 4 of 4

Thread: Form tags undefine everything

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Monte96 gave this really cool example but when I try to put in form tags it tells me "selTest" is undefined. Any cures? I tried appending "Form." with out success it only told me form was undefined.I want the form tags so I can use existing forms and templets that do submits.

    code:
    <HTML>
    <HEAD>
    <TITLE>test.htm</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function selTest_onchange(){
    var intloop;
    var myvalue = selTest.options(selTest.selectedIndex).value;
    for(intloop=1; intloop < selTest2.options.length; intloop++){
    if (selTest2.options(intloop).value == myvalue) selTest2.options(intloop).selected=true;
    }
    }
    -->
    </SCRIPT>
    </HEAD>
    <BODY>
    <Form>
    <SELECT onchange="selTest_onchange()" ID="selTest" NAME="selTest">
    <OPTION VALUE="1">One
    <OPTION VALUE="2">Two
    <OPTION VALUE="3">Three
    <OPTION VALUE="4">Four
    <OPTION VALUE="5">Five
    </SELECT>
    <SELECT ID="selTest2" NAME="selTest2">
    <OPTION VALUE="1">A
    <OPTION VALUE="2">B
    <OPTION VALUE="3">C
    <OPTION VALUE="4">D
    <OPTION VALUE="5">E
    </SELECT>
    </Form>
    </BODY>
    </HTML>

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Give your form a name, then append the name to the selTest.

    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Hi, Thanks that worked.
    New Problem: I've been using this code to simulate the rows in my database so I don't have to resubmit to the Server. Works great with a dropdown, but I need a way to store and retrieve database values on a page so I can populate radio boxes based on the selected index. Again, I don't want to submit to the server

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Best way then is to build your query, open your recordset, use the getrows method to store the contents of your recordset into an array, then write the contents of the server side array into a client side array at runtime. As the page is being generated, you can use Response.write to create client side script that stores your entire array in the page. Downside of this is the page is bigger because it has all of the data on it (in text no less). But you save roundtrips to the server and the page will be able to dynamically change form elements without refreshing.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

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



Click Here to Expand Forum to Full Width