Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.form.action = ERROR!!!!!! 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I have a bunch of form validation going on that if it all passes, then I want it to a URL that I have declared as a string.

Problem is it seems to work fine when I test it in NN 6.2, but when I try IE 5.5 it gives an error "Error: Object doesn't support this property or method"

/* Code that pulls the error */

document.form.action = strUrl
document.form.submit()

I've checked several references and this above seems to be valid syntax.

Any ideas?

Thanks
Jack
liquid_29@hotmail.com
 
I've got this function and it works perfect with IE 5.5
(<%strID%> is ASP code.. is some number)

function OnBestandToevoegen()
{
strGoTo = &quot;upload_bestand.asp?id=<%=strID%>&quot;

document.forms.MyFormName.method = &quot;POST&quot;
document.forms.MyFormName.action = strGoTo
document.forms.MyFormName.submit()
}
</SCRIPT>
 
I tried this, bit the error is still raised. Not sure what is the problem.

Jack
 
Can you include your full script? I have an idea that your placement is wrong.

John Pasko
john@rts-sd.com
&quot;No matter where you go, there you are.&quot;
 
Here it is...I think I am going nuts.

<script language=&quot;JavaScript&quot;>
<!--
function SubmitResults(){
var iRespondentID = '<%=Request.QueryString(&quot;RID&quot;)%>';
var iIDID = '<%=Request.QueryString(&quot;IDID&quot;)%>';
var iParticipantID = '<%=Request.QueryString(&quot;PID&quot;)%>';
var iOrgID = '<%=Request.QueryString(&quot;OID&quot;)%>';
var strUrl =&quot;success_comp.asp?PID=&quot;+iParticipantID+&quot;&IDID=&quot;+iIDID+&quot;&RID=&quot;+iRespondentID;

document.form1.method = &quot;POST&quot;;
document.form1.action = + strUrl;
document.form1.submit();
}
function ValidateRadio(){
var qnum = 420
var n = 0
for(q=0;q<qnum;q++){ // Loop Level 1
if(document.form1.elements[q].checked == true){
n++;
}
}
if(n<5){
alert(&quot;You must provide a response for each competency statment. Please review your responses and resubmit. Thank You.&quot;);//executing on script side 'Steps out if not checked
return false;
}
else{
// Form activity
SubmitResults();
return true;
}

}
// End hiding script -->
</script>
 
Try this:

function ValidateRadio(){
var qnum = 420
var n = 0
for(q=0;q<qnum;q++){ // Loop Level 1
if(document.form1.elements[q].checked == true){
n++;
}
}
if(n<5){
alert(&quot;You must provide a response for each competency statment. Please review your responses and resubmit. Thank You.&quot;);//executing on script side 'Steps out if not checked
return false;
}
else{
return true;
}
form1.action = &quot;your page&quot;;
form1.submit();
}

See if this works. Let me know.

John Pasko
john@rts-sd.com
&quot;No matter where you go, there you are.&quot;
 
I made a page with your script and didn't get any errors. Tested in IE5, Opera6.0 and N6.2.
Maybe by blank form doesn't allow to see all the datails? Anyway, check if the value of strUrl is what you need, just add alert(strUrl) after document.form1.method = &quot;POST&quot;; string.
What I got is this:
success_comp.asp?PID=<%=Request.QueryString(&quot;PID&quot;)%>&IDID=<%=Request.QueryString(&quot;IDID&quot;)%>&RID=<%=Request.QueryString(&quot;RID&quot;)%>

Always use this for debugging your scripts.
Also, just to know - why do you do += here:
document.form1.action = + strUrl; ???
Is just = not enough?

In any case, it sould be like this:
document.form1.action += strUrl;
Fix it and see what happens.

I ask these things because sometimes the reason for errors is not so obvious.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top