Dropdown server validation
Hi.. I went thru the steps of validating adropdown for checkout.php & confirm.php and all choices result in being rejected back to the checkout page .. How do I make only the null choice the one to be rejected
Hi.. I went thru the steps of validating adropdown for checkout.php & confirm.php and all choices result in being rejected back to the checkout page .. How do I make only the null choice the one to be rejected
make sure the option does not have a value:
<option value="">Make a selection</option
and use the required not blank validation type.
ok ... onw more question, do i choose an existing variable from Server Variables or do I create and name my own variable
click the lightning bolt icon and chose the select list form element from the dynamic bindings.
here's the code generated by the WA behaviors...
<select name="Ship_Type" id="Ship_Type">
<option value="" selected="selected" <?php if (!(strcmp("", $_SERVER['ShipType']))) {echo "selected=\"selected\"";} ?>>Shipping Options</option><option value="1" <?php if (!(strcmp(1, $_SERVER['ShipType']))) {echo "selected=\"selected\"";} ?>>UPS Ground</option>
<option value="2" <?php if (!(strcmp(2, $_SERVER['ShipType']))) {echo "selected=\"selected\"";} ?>>USPS Priority</option>
<option value="3" <?php if (!(strcmp(3, $_SERVER['ShipType']))) {echo "selected=\"selected\"";} ?>>USPS Express Mail</option>
<option value="4" <?php if (!(strcmp(4, $_SERVER['ShipType']))) {echo "selected=\"selected\"";} ?>>USPS 1st Class Mail</option>
<option value="5" <?php if (!(strcmp(5, $_SERVER['ShipType']))) {echo "selected=\"selected\"";} ?>>International Express</option>
<option value="6" <?php if (!(strcmp(6, $_SERVER['ShipType']))) {echo "selected=\"selected\"";} ?>>International Priority</option>
</select>
<?php
if (ValidatedField('confirm_136','confirm_136')) {
if ((strpos((",".ValidatedField("confirm_136","confirm_136").","), "," . "1" . ",") !== false || "1" == "")) {
if (!((strpos((",".ValidatedField("confirm_136","confirm_136").","), "," . "1" . ",") !== false || "1" == ""))) {
?>
<span class="red"> PLEASE CHOOSE SHIPPING METHOD </span>
<?php //WAFV_Conditional confirm.php confirm_136(1:1)
}
}
}?>
I dont understand what the question is.
please provide more details.
HI Jason .. below is a summary of the steps i took ..
- on the confirm.php page - added Data Form binding to checkout.php
- created a server validation name of ShipType - with a failed redirect of checkout.php ( is this what i need to do or do i choose one of the pre-existing server validations like HTTP Accept ?)
- added a validation show if msg on checkout.php if they do not choose a ship type
- selected the dropdown form element and clicked lightning bolt and bound to my server validation ShipType
result: all choices force you back to checkout.php and the msg doesn't show
toydb_for_sale2.php
Thanks ..
Hi Jason .. Ray helped me with a USPS issue so i had to remove the code to test - can you just validate that my steps in the last post were correct and I will try it again ... thanks
all correct except:
- created a server validation name of ShipType - with a failed redirect of checkout.php ( is this what i need to do or do i choose one of the pre-existing server validations like HTTP Accept ?)
in the server validation behavior, select the Required / not blank validation type.
for the server variable, click the lightning bolt icon and select the Ship Type select list, then click the plus button to add the validation to the list.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.