473,561 Members | 3,493 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form redirect after validation

384 Contributor
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 1989
8,658 Recognized Expert Moderator Expert
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
93 New Member
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>
  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

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 performing the validation check on the values that were entered into the form, I simply repost the form to perform the PHP validation. If any of the...
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 numbers must be ten e.g. "123456-78-9 0" should be allowed and also "12 34 67 67---56" also, but not "123456789". This should show a...
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 hidden portions of the form, used for setting the recipient address, sender address, etc... ...
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 believe I am adding a form-level validation. Is it wise to also include the table-level validation for the above constraint? For instance, go to...
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 confirmation which uses a compare validator and a validation summary. On my development server, this form performs as designed. However, when deployed on a...
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 way to validate a form field by field like AJAX would do, but to keep it synchronous? i.e. one action, one validation. Thanks,
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 "Submit" sends an email to us. I am a complete newbie re asp, but looking at the code, it looks to me as if a error is generated if any of the fields...
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 validate the form. please tell me the part that makes the images appear/disappear. I'm new to javascript, thX ;-)
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 validate the form. please tell me the part that makes the images appear/disappear. I'm new to javascript, thX ;-)
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.