close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Validate field1 bigger than field2

Thread began 8/19/2013 3:50 am by info4753 | Last modified 8/19/2013 2:01 pm by info4753 | 4939 views | 6 replies |

info4753

Validate field1 greater than field2

How do I validate that the values in field1 must be greater that the values in field2?

I can't find a way to accomplish this. Thanx for any help.

Sign in to reply to this post

Jason ByrnesWebAssist

use numeric validation. For the maximum number, enter the following code:

php:
<?php echo((isset($_POST["field2"]))?$_POST["field2"]:""?>



assuming the name of the filed is field2

Sign in to reply to this post

info4753

Thx Jason.

I'm using the following code:

if ("" == "") {
$WAFV_Redirect = "res_formular1.php?ERROR=8&Sitzungszimmer=".$_SESSION['sessSitzungszimmer']."&Datum=".$_SESSION['sessDatum']."&Dauer=".$_SESSION['sessDauer']."&Bestuhlung=".$_SESSION['sessBestuhlung']."&EventVon=".$_SESSION['sessEventVon']."&EventBis=".$_SESSION['sessEventBis']."";
$_SESSION['WAVT_resformular2_612_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateNM(((isset($_POST["EventVon"]))?$_POST["EventVon"]:"") . "",0,((isset($_POST["EventBis"]))?($_POST["EventBis"]-15):""),"",",.",true,4);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"resformular2_612");
}
}

So the validation takes place before the page loads, this works. But If I submit the form the validation runs again and redirects to the first page.

Sign in to reply to this post

Jason ByrnesWebAssist

the validation shouldn't happen on page load, it happen when the form submits.

Sign in to reply to this post

info4753

I've got 2 pages, the 1st with the formular fields and the second as a control page where the insert behaviour are located. Now I use the submit trigger (InfraparkReservation_submit) from the first page but it still doesn't accept submitting the form on the 2nd page:


if ((((isset($_POST["InfraparkReservation_submit"]))?$_POST["InfraparkReservation_submit"]:"") != "")) {
$WAFV_Redirect = "res_formular1.php?ERROR=8&Sitzungszimmer=".$_SESSION['sessSitzungszimmer']."&Datum=".$_SESSION['sessDatum']."&Dauer=".$_SESSION['sessDauer']."&Bestuhlung=".$_SESSION['sessBestuhlung']."&EventVon=".$_SESSION['sessEventVon']."&EventBis=".$_SESSION['sessEventBis']."";
$_SESSION['WAVT_resformular2_321_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateNM(((isset($_POST["EventVon"]))?$_POST["EventVon"]:"") . "",0,((isset($_POST["EventBis"]))?($_POST["EventBis"]-15):""),"",",.",true,5);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"resformular2_321");
}
}

The two submit buttons have the same name "InfraparkReservation_submit". Does that matter?

Sign in to reply to this post

Jason ByrnesWebAssist

  The two submit buttons have the same name "InfraparkReservation_submit". Does that matter?  



yes, the submit buttons should use unique names.

Sign in to reply to this post

info4753

Thanks Jason, now it works :-)

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...