close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Validation Binding Does not remember the value selected

Thread began 5/09/2012 2:23 pm by sfranzken73972 | Last modified 5/14/2012 12:28 pm by Jason Byrnes | 1945 views | 5 replies |

sfranzken73972

Validation Binding Does not remember the value selected

How come in my first list menu, category the validation bindings do not seem to remember what I select upon failed submission?

<form action="" name="form2" id="form2"> <div class="formCont">
<div class="formRow">
<div class="wdth290 fl">


<span class="redAsterick">*</span>SEXuation <span class="redAsterick">
<?php
if (ValidatedField('form','form')) {
if ((strpos((",".ValidatedField("form","form").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
required
<?php //WAFV_Conditional form.php form(1:)
}
}
}?></span>
<p class="select">
<select name="category" class="default" tabindex="2" title="">
<?php
do {
?><option value="<?php echo $row_rsCats['id']?>"<?php if (!(strcmp($row_rsCats['id'], (ValidatedField("form","category"))))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsCats['category']?></option>
<?php
} while ($row_rsCats = mysql_fetch_assoc($rsCats));
$rows = mysql_num_rows($rsCats);
if($rows > 0) {
mysql_data_seek($rsCats, 0);
$row_rsCats = mysql_fetch_assoc($rsCats);
}
?>
</select>
</p>
<div class="cl"></div>
</div>
<div class="fl"><span class="redAsterick">*</span>FEEDBACK <span class="redAsterick"> required </span>
<p class="select">
<select name="subCategory" class="default" tabindex="2">
<?php
do {
?>
<option value="<?php echo $row_rssubCats['id']?>"><?php echo $row_rssubCats['subcategory']?></option>
<?php
} while ($row_rssubCats = mysql_fetch_assoc($rssubCats));
$rows = mysql_num_rows($rssubCats);
if($rows > 0) {
mysql_data_seek($rssubCats, 0);
$row_rssubCats = mysql_fetch_assoc($rssubCats);
}
?>
</select>
</p>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="formRow">
<div class="wdth290"><span class="redAsterick">*</span> YOUR E-MAIL<span class="redAsterick"> required </span>
<p class="txtField"><span>
<input name="email" type="text" id="email">
</span></p>
<div class="cl"></div>
</div>
</div>
<div class="formRow"> <span class="redAsterick">*</span>YOUR QUESTION <font size="2">
You have <input readonly type="text" name="countdown2" size="3" value="85"> characters left.</font>
<p class="txtField width500"><span>
<input name="limitedtextfield" type="text" onKeyDown="limitText(this.form.limitedtextfield,this.form.countdown2,85);"
onKeyUp="limitText(this.form.limitedtextfield,this.form.countdown2,85);" maxlength="85"><br>
<br>
<br>
<br>


</span></p>

<div class="cl"></div>
</div>
<div class="formRow">
<p>&nbsp;</p>

<p><span class="redAsterick">*</span> MESSAGE You have
<input readonly type="text" name="countdown" size="3" value="284">
characters left.</font>
</p>
<p class="txarea"><span>
<textarea name="limitedtextarea" onKeyDown="limitText(this.form.limitedtextarea,this.form.countdown,284);" onKeyUp="limitText(this.form.limitedtextarea,this.form.countdown,284);"></textarea>
<br>
<font size="1"><br>
<br>
<br>
please type the captcha code:<br>
<img src="webassist/captcha/wavt_captchasecurityimages.php?width=200&height=50&field=Security_Code_1&bgcolor=FFFFFF&transparent=0&bgimage=&gridfreq=20&gridcolor=000000&gridorder=behind&noisefreq=20&noisecolor=000000&noiseorder=behind&characters=5&charheight=&font=fonts/MODERNA_.TTF&textcolor=000000" alt="security code" name="capt1" width="32" height="32" id="capt1" /><br>
<br>
<input name="Security_Code_1" type="text" class="text-field" id="Security_Code_1" value="" />
</span></p>
<div class="cl"></div>
</div>
<div class="formRow fr"> <a href="#" title="Ask">
<input name="button" type="image" id="button" value="Submit" src="images/askBtn.gif">
</a> </div>
<div class="cl"></div>
</div></form>

Sign in to reply to this post

Jason ByrnesWebAssist

imposible to tell without seeing the entire page code rather than just the form code, but my guess is that the validation behavior is expecting the information to be sent through the POST, but since your form does not set a method, it is using GET.

try changing:
<form action="" name="form2" id="form2">

to:
<form action="" name="form2" id="form2" method="POST">


if it is still not working, compress the php file to a zip archive and attach the zip file to your reply.

Sign in to reply to this post

sfranzken73972

Thanks but did not work

Here is the form and so far I only applied the validation to the first list menu category.
Again the problem is it does not remember what I selected when I hit submit.

Thank you!

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

Jason ByrnesWebAssist

you're testing this the wrong way.

the validated entries binding will only have a value if form validation fails

Since the only form element you are validating is the category select list, you should be using the validated entries binding on another form element, and testing in a way that would cause the category list to fail.

you are using required not blank validation on the select list, but you don't have a blank option, meaning that there will always be a selection made, so validation on the category will never fail.


add validation for the email address field, then submit the form without entering an email address, but change the category select list, that would be a more valid text than what you have set up so far....

Sign in to reply to this post

sfranzken73972

Thanks Jason

That worked thank you

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

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