473,320 Members | 2,071 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,320 software developers and data experts.

Form redirect after validation

384 256MB
I have a form submitting and if it fails validation it stays on the same page with and error message, if it succeeds I need to forward on the data to another URL, can anyone suggest a way to to do this?

I have the form up and working and validating fine, I just can pass the values onto another URL when all validation has succeeded??
Apr 12 '11 #1
2 1980
Dormilich
8,658 Expert Mod 8TB
that depends on what the other page does with the data. the easiest way is certainly include the script, so that it can use the lingering (and validated) form data.
Apr 12 '11 #2
Expand|Select|Wrap|Line Numbers
  1. <form name="form1" action="page2.php" onsubmit="return check_validation()">
  2. <input type="text" name="txt1" value="">
  3. <br>
  4. <input type="text" name='txt2' value="">
  5. <br>
  6. <input type="submit" name="submit" value="SUBMIT">
  7. </form>
  8.  
  9. <script type="text/javascript">
  10. function check_validation()
  11. {
  12.    if(form1.txt1.value == "")
  13.    {
  14.        alert("Enter First Value !!!!");
  15.        return false;
  16.    }
  17.    else if(form1.txt2.value == "")
  18.    {
  19.      alert("Enter Second value !!!!");
  20.      return false;
  21.    }
  22.    else
  23.    {
  24.       return true;
  25.    }
  26. }
  27. </script>
May 1 '12 #3

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

Similar topics

4
by: TG | last post by:
I have a validation form that must behave differently based on the results of a PHP validation check. I have a post command at the top of my form that calls itself. I don't leave the form when...
1
by: Martin Nadoll | last post by:
Hello, i have a few problems with form field validation: First i have to check, wether a field is filled with 10 integer numbers. Also allowed is " " and "-" but no letters, and the input of ...
7
by: Armand Karlsen | last post by:
On one page of a site I'm doing for a college project, I have a feedback form: http://www.zen62775.zen.co.uk/Test/contact/contact_feedback.html All parts of this page validate, except for the...
2
by: Kostas | last post by:
Just a quick question on this issue. Assume a small set of fixed values for a field. For instance Field Gender, values: Male, Female, Unknown If I create a Combo Box with the above values, I...
4
by: John Slate | last post by:
I have built a simple web form that uses input validation. I use the EnableClientScript option to produce a javascript alert box when input errors occur. The only validation is a password...
1
by: AECL_DEV | last post by:
Hello Everyone, Ive seen alot of people saying that the best way to AJAX Validate a form is through the submit button, because validation should be synchronous. Im wondering, is there any good...
0
by: Ken | last post by:
We have a shared hosting plan (Windows-based) with GoDaddy.com. GD.com has a "generic" form mailer script (gdform.asp) that allows us to set up a "Contact Us" page, which, when the user clicks...
2
by: parsa28 | last post by:
Hi there, could someone help me with a form field validation that puts one of two images (one a "tick" saying the field is correct and a "red dot" saying the field is not validated) ? I know how to...
3
by: parsa28 | last post by:
Hi there, could someone help me with a form field validation that puts one of two images (one a "tick" saying the field is correct and a "red dot" saying the field is not validated) ? I know how to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.