473,411 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

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 2320
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

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

Similar topics

4
by: janet | last post by:
hey hi... this in in continuation to my other post. i am trying hard and cannot find out whats the problem. i am getting crazy...please asp experts ...do resolve the problem...its something very...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
9
by: Eric George | last post by:
Hi, Has anyone had any success using jscript submit method in their VS.NET projects? For example I have some client processing in a script function then call <form name>.submit(); This won't...
1
by: Joel Barsotti | last post by:
Is there anything builtin to ASP.net that allows you to tie a text box to a button so when you press enter in the text box it emulates clicking a near by button. I've coded up some client side...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
1
by: kavithadevan | last post by:
Hi, I am creating websites in my event search form i am have 2 options(which is in radio button)one is countryname and another one is state name with search field(Its in first table).If i run my...
1
by: Sudhakar | last post by:
i am using a self submitting for using php <form action="<?php echo $_SERVER; ?>" method="POST" id="test2" name="registrationform"> the registration page starts with a lot of terms and other...
4
by: j1dopeman | last post by:
Hi, I'd like to use a button to save and then submit a form. I can set the onlick of the button to mahButton_click or submit, but I can't figure out how to do both. It looks like c# can't...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.