call ASP Procedure with onChangeRSS

5 replies

Last post Nov 16, 2013 07:33 PM by BTuygun

  • call ASP Procedure with onChange

    Jan 18, 2006 07:40 PM|fustrated|LINK

    hi,

    I have tried to call a procedure like this, but I am receiving an error:

                <select size=3 onChange=<%call Procedure(options[selectedIndex].value)%>>

                    <option></option>

                   <option></option>

                   <option></option>

               </select>

    is there any way around this problem.

    Thanks

  • Re: call ASP Procedure with onChange

    Jan 19, 2006 08:34 AM|tomkmvp|LINK

    You're trying to mix server-side code with client-side code.  See if "Remote Scripting" will help:
    http://msdn.microsoft.com/library/en-us/dnclinic/html/scripting041299.asp

  • Re: call ASP Procedure with onChange

    Jan 19, 2006 10:34 AM|Silvers5™|LINK

    Indeed.. you want to populate a second list or fields based on the first drop list?

    You need actually to resubmit to the page:

    check these links.. http://www.devguru.com/features/knowledge_base/A100209.html
    http://www.programmersresource.com/forum/showthread.php?s=fab60f394b5bbcf7aad87925e554116f&threadid=770

     

    Michel
    IIS MVP,MCDBA,MCAD,MCSA,CCNA
  • Re: call ASP Procedure with onChange

    Jan 19, 2006 10:40 AM|Silvers5™|LINK

    In your case you should do most probably something like:

    <%

    if request("supp") <> "" then

    'Process or call function here 

    end if

    %>

    <html>

    <head>
    <script language="JavaScript">
    function Supp(){
    location.replace("myform.asp?supp=" + document.MyForm.Supplier.value);
    alert ("Going to myform.asp?supp=" + document.MyForm.Supplier.value);
    }
    </script>
    <title>New Page 1</title>
    </head>

    <body>

    <form method="POST" name="MyForm" action="find.asp">
      <p>Supplier:<select size="1" name="Supplier" onChange="Supp()">
        <option value="1">IBM</option>
        <option value="2">Nokia</option>
        <option value="3">Ericsson</option>
      </select><br>
      Location: <select size="1" name="Component">
      </select><br>
      <input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>

    </body>

    </html>

     

    Michel
    IIS MVP,MCDBA,MCAD,MCSA,CCNA
  • Re: call ASP Procedure with onChange

    Jan 24, 2006 04:59 PM|fustrated|LINK

    Thanks Silvers5™.

  • Re: call ASP Procedure with onChange

    Nov 16, 2013 07:33 PM|BTuygun|LINK

    Thanks...