Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Mar 2003
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts

    why JS in asp not working

    there's some code the JS in the ASP Else case which does not initstantiate the form to post, the page displays under the right condition but no js working. The code in the else case works if i cut and paste into a new browser. Does not seem to work in this asp situation, any ideas how?

    Code:
    <%	
    If gstrProfessionId = "4" Then   
    %>
    <!--#include file="registrationContinued2.asp"-->
    <% 
    ElseIf gstrProfessionId = "11" Then  
    %>
    <!--#include file="registrationindustry2.asp"-->
    <% 
    ElseIf gstrProfessionId = "1" Then  
    %>
    <!--#include file="registrationnurse2.asp"-->
    <%
    ElseIf gstrProfessionId = "3" Then  
    %>
    <!--#include file="registrationpharamist2.asp"-->
    <% 
    Else
    '   also tried code below as an include like above without any luck
    %>
    
    <html><head>
    <script type="text/javascript">
    function setFocus(){
    document.registrationFrm.submit();
    }
    window.onload = setFocus;
    </script>
    </head><body>
    <form action="validate.asp" method="POST" name="registrationFrm">
    <% 
    For Each thing In Request.Form 
    Response.Write "<input type=""hidden"" name=""" & thing & """ value=""" & Request.Form(thing) & """>" & vbCrLf 
    Next 
    %>
    <p align="center"> <p align="center">
    Your information has been validated, please click the button below to begin the survey.<p align="center">
    <input type="submit" value="Submit" />
    
    </form>
    </body>
    </html>
    
    
    <%
    End If
    %>

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What error are you getting?

  • #3
    Regular Coder
    Join Date
    Mar 2003
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the js error is object does not support this property of method and points to this line:

    document.forms['registrationFrm'].submit();


    I have even tried using a setTimeInterval and when the time runs out i get the same error:

    </form>
    <script>
    window.onload = function(){
    setTimeout("damnDelay()", 3000); //2 secs
    }

    function damnDelay() {
    document.forms['registrationFrm'].submit();
    }
    </script>


    //could this be happening becasue i'm under a SSL ?

  • #4
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Add a name to your button. Note the Uppercase S
    Code:
    <input type="submit" name="Submit" value="Submit" />


  •  

    Posting Permissions

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