close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Server Validation for checkbox

Thread began 12/14/2009 7:52 pm by JBWebWorks | Last modified 12/15/2009 5:28 pm by JBWebWorks | 1647 views | 4 replies |

JBWebWorks

Server Validation for checkbox

I have a checkbox named tour_name within a repeat region(produces several checkboxes) and the checked value is
<?php echo $row_rs_pricing['tour_name']; ?>

I want to use validation toolkit to server validate that at least 1 checkbox is checked.
Using required/not blank produced this code---

<?php
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos($_SERVER["HTTP_REFERER"], $_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]) > 0) && isset($_POST)) {
$WAFV_Redirect = "";
$_SESSION['WAVT_camptelregistration_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["tour_name"]))?$_POST["tour_name"]:"") . "",true,1);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"camptelregistration");
}
}
?>

This did not work; I tested and did not check any box name="tour_name" but the page submitted?

thanks for your help,
Jim Balthrop

Sign in to reply to this post

Jason ByrnesWebAssist

Please send a copy of your page so I can see the code in context. that validation code looks correct, I will need to see how the form is created and where on the page the validation code is placed.

Sign in to reply to this post

JBWebWorks

thanks Jason

attached is page in question

Attached Files
web_assist_zip.zip
Sign in to reply to this post

Jason ByrnesWebAssist

The action of the form is set to post to another page:
<form action="checkout.php"


the server validation server behavior needs to be on the forms action page. you need to apply the Server Validation server behavior to the checkout.php page.

Sign in to reply to this post

JBWebWorks

Jason,

I hope you get a HUGE Christmas bonus! You deserve it.

thanks again, that worked perfectly.
I had never validated on a different page than the page with the form.
I don't use the form action much(usually have UE or insert do the redirect), but found that in order to get the form POST info on the checkout page, it had to have the form action take it to that page.
Anyway, I may end up having to use eCart on this domain as i can't get PayPal ecommerce to do exactly what i want.

Happy Holidays,
Jim Balthrop

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