close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Menus loosing selection after server validation fail

Thread began 5/28/2018 5:02 am by mrs | Last modified 5/28/2018 8:58 am by Ray Borduin | 276 views | 1 replies |

mrs

Menus loosing selection after server validation fail

I've got loads of menus and loads of radio buttons on a page; when the page is submitted and fails validation, the menus loose their selection. They are only static options rather than dynamic.

I have:

<select class="formMenufield_Small" name="fld_qq_doublerooms" id="fld_qq_doublerooms" rel="<?php echo((isset($_GET["invalid"])?ValidatedField("quickquote","fld_qq_doublerooms"):"")); ?>" tabindex="13" title="Please enter a value.">
<option value="">N/A</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>


Based on other answer in the forums, without success I have tried:

<select class="formMenufield_Small" name="fld_qq_doublerooms" id="fld_qq_doublerooms" rel="<?php echo((isset($_GET["invalid"])?ValidatedField("quickquote","fld_qq_doublerooms"):"")); ?>" tabindex="13" title="Please enter a value.">
<option value="" <?php if (!(strcmp("", ((isset($_POST["fld_qq_doublerooms"]))?$_POST["fld_qq_doublerooms"]:"")))) {echo "selected=\"selected\"";} ?>>N/A</option>
<option value="1" <?php if (!(strcmp("1", ((isset($_POST["fld_qq_doublerooms"]))?$_POST["fld_qq_doublerooms"]:"")))) {echo "selected=\"selected\"";} ?>>1</option>
<option value="2" <?php if (!(strcmp("2", ((isset($_POST["fld_qq_doublerooms"]))?$_POST["fld_qq_doublerooms"]:"")))) {echo "selected=\"selected\"";} ?>>2</option>
<option value="3" <?php if (!(strcmp("3", ((isset($_POST["fld_qq_doublerooms"]))?$_POST["fld_qq_doublerooms"]:"")))) {echo "selected=\"selected\"";} ?>>3</option>
<option value="4" <?php if (!(strcmp("4", ((isset($_POST["fld_qq_doublerooms"]))?$_POST["fld_qq_doublerooms"]:"")))) {echo "selected=\"selected\"";} ?>>4</option>
</select>


What have I done wrong? Also, is the rel="abc etc" for the select line of code required?

FYI: I want the value for N/A to be blank if possible, but if that is causing the error, then I will use 0, but even that didn't work for me. Also, it is literally 1, 2, 3 and 4 for the options, so I don't see the need to have a recordset populate the menu options.

Thanks in advance.

Sign in to reply to this post

Ray BorduinWebAssist

Use:

php:
<option value="">N/A</option>

<option value="1" <?php echo(((isset($_GET["invalid"])?ValidatedField("quickquote","fld_qq_doublerooms"):"")=="1")?"selected":"" ); ?>>1</option>
<option value="2" <?php echo(((isset($_GET["invalid"])?ValidatedField("quickquote","fld_qq_doublerooms"):"")=="2")?"selected":"" ); ?>>2</option>
<option value="3" <?php echo(((isset($_GET["invalid"])?ValidatedField("quickquote","fld_qq_doublerooms"):"")=="3")?"selected":"" ); ?>>3</option>
<option value="4" <?php echo(((isset($_GET["invalid"])?ValidatedField("quickquote","fld_qq_doublerooms"):"")=="4")?"selected":"" ); ?>>4</option>
Sign in to reply to this post
Did this help? Tips are appreciated...

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