Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-19-2006, 06:45 AM   PM User | #1
havey
Regular Coder

 
Join Date: Mar 2003
Posts: 165
Thanks: 0
Thanked 0 Times in 0 Posts
havey is an unknown quantity at this point
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
%>
havey is offline   Reply With Quote
Old 04-19-2006, 02:57 PM   PM User | #2
degsy
Senior Coder

 
Join Date: Nov 2002
Location: North-East, UK
Posts: 1,265
Thanks: 0
Thanked 0 Times in 0 Posts
degsy is on a distinguished road
What error are you getting?
degsy is offline   Reply With Quote
Old 04-20-2006, 12:38 AM   PM User | #3
havey
Regular Coder

 
Join Date: Mar 2003
Posts: 165
Thanks: 0
Thanked 0 Times in 0 Posts
havey is an unknown quantity at this point
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 ?
havey is offline   Reply With Quote
Old 04-25-2006, 03:57 PM   PM User | #4
degsy
Senior Coder

 
Join Date: Nov 2002
Location: North-East, UK
Posts: 1,265
Thanks: 0
Thanked 0 Times in 0 Posts
degsy is on a distinguished road
Add a name to your button. Note the Uppercase S
Code:
<input type="submit" name="Submit" value="Submit" />
degsy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:10 AM.


Advertisement
Log in to turn off these ads.