469,085 Members | 1,027 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,085 developers. It's quick & easy.

Linking submit button to new page

Hi all,
I am a begineer and working on a project. Facing trouble linking a submit buuton to a page of my choice.Script i am using is:

Expand|Select|Wrap|Line Numbers
  1. <SCRIPT language=JavaScript><!--
  2. function validate(form) {
  3.   for (var i=0; i <form.elements.length; i++) {
  4.     if (form.elements[i].type == 'button') {
  5.       if (!form.elements[i].clicked) {
  6.         alert('Complete the 1st line checks!');
  7.         return false;
  8.       }
  9.     }
  10.   }
  11.   return true;
  12. }
  13. //--></SCRIPT>
  14.  
  15. <FORM onsubmit="return validate(this)">
  16. <P align=center><STRONG><FONT size=3>Error 680-Flashing adsl light</FONT></STRONG></P>
  17. <P> </P>
  18. <P> </P>
  19. <P> </P>
  20. <P> </P>
  21. <P>Modem is connected to master bt socket.<INPUT onclick=this.clicked=true type=button value=Done><BR><BR>Extension wire has been removed.<INPUT onclick=this.clicked=true type=button value=Done><BR><BR>Extra devices hve been removed from the line.<INPUT onclick=this.clicked=true type=button value=Done><BR><BR>Microfilters have been swapped.<INPUT onclick=this.clicked=true type=button value=Done> <BR><BR><BR><BR><INPUT type=submit onchange="if (this.disabled) this.selectedIndex=0" value="Completed the 1st line checks." name=mySel><A onclick="rusure(); return false;" href=""></A></P></FORM>
  22.  



I want to link the submit button with value=" Completed the 1st line checks" to a new page as well or in other words once the user has completed all the checks and then presses the submit button it takes him to a page of my choice.

Can any one help,please?
Aug 30 '07 #1
5 2134
r035198x
13,262 8TB
Hi all,
I am a begineer and working on a project. Facing trouble linking a submit buuton to a page of my choice.Script i am using is:


<SCRIPT language=JavaScript><!--
function validate(form) {
for (var i=0; i <form.elements.length; i++) {
if (form.elements[i].type == 'button') {
if (!form.elements[i].clicked) {
alert('Complete the 1st line checks!');
return false;
}
}
}
return true;
}
//--></SCRIPT>

<FORM onsubmit="return validate(this)">
<P align=center><STRONG><FONT size=3>Error 680-Flashing adsl light</FONT></STRONG></P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P>Modem is connected to master bt socket.<INPUT onclick=this.clicked=true type=button value=Done><BR><BR>Extension wire has been removed.<INPUT onclick=this.clicked=true type=button value=Done><BR><BR>Extra devices hve been removed from the line.<INPUT onclick=this.clicked=true type=button value=Done><BR><BR>Microfilters have been swapped.<INPUT onclick=this.clicked=true type=button value=Done> <BR><BR><BR><BR><INPUT type=submit onchange="if (this.disabled) this.selectedIndex=0" value="Completed the 1st line checks." name=mySel><A onclick="rusure(); return false;" href=""></A></P></FORM>





I want to link the submit button with value=" Completed the 1st line checks" to a new page as well or in other words once the user has completed all the checks and then presses the submit button it takes him to a page of my choice.

Can any one help,please?
Hi and Welcome to TSDN.
Use code tags next time when posting code.
Set the destination path as the action of the form being submitted.

Moved to Javascript forum.
Aug 30 '07 #2
acoder
16,027 Expert Mod 8TB
I want to link the submit button with value=" Completed the 1st line checks" to a new page as well or in other words once the user has completed all the checks and then presses the submit button it takes him to a page of my choice.
You don't even need Javascript for this. Just set the action attribute:
[HTML]<form name="..." action="theURL.php" onsubmit="...">[/HTML]
Aug 31 '07 #3
You don't even need Javascript for this. Just set the action attribute:
[HTML]<form name="..." action="theURL.php" onsubmit="...">[/HTML]



Thankyou so much,
but i didn't get it. Could you reply with the complete script. I am very new to scripts. I dont know what to put in form name="..." and onsubmit="...".
Could you please reply with the complete script.
Aug 31 '07 #4
acoder
16,027 Expert Mod 8TB
Thankyou so much,
but i didn't get it. Could you reply with the complete script. I am very new to scripts. I dont know what to put in form name="..." and onsubmit="...".
Could you please reply with the complete script.
For name, just put any name that you want for your form. I left the onsubmit out because you already had that in your original code.
Aug 31 '07 #5
Thnky you once again.
You are a genious.
Will get back to you if i face any more issues.
Aug 31 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by CJM | last post: by
9 posts views Thread by Eric George | last post: by
1 post views Thread by Joel Barsotti | last post: by
1 post views Thread by kavithadevan | last post: by
1 post views Thread by Sudhakar | last post: by
4 posts views Thread by j1dopeman | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.