close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to maintain validated entry on multiple select list or single option dropdown

Thread began 3/31/2015 3:08 pm by Sylvia | Last modified 4/16/2015 2:46 pm by Ray Borduin | 636 views | 3 replies |

Sylvia

How to maintain validated entry on multiple select list or single option dropdown

I have a multiple select list and a single select dropdown, both of which are populated from (different) recordsets, and their initial values come from another (same) recordset. Both of these fields have WA Validation ('required').

My issue is that I can't find a way to also have these fields hold any changes made if another field fails validation on submit - the list and dropdown return to the initial value. If I bind to the validated entries, I lose the initial value from the main recordset.

Multi-select list code:

<select name="services[]" size="25" multiple class="formListfield_Large" id="services" tabindex="81" title="To make multiple selections, hold down your control key and click on each item to highlight. To select all, or a block, hold down your shift key and click on the first and last items in the block." rel="<?php echo(WA_coalesce(array(WA_getSavedFormValue("CheckoutWizard_Cool_nzanlp","services"),(isset($_GET["invalid"])?ValidatedField("confirmcart","services"):"".$row_memberDetails['servicesOffered'] ."")))); ?>">
<?php
do {
?>
<option value="<?php echo $row_services['categoryLabel']?>"<?php if(isset($row_memberDetails["servicesOffered"]) && is_array(explode(",", $row_memberDetails["servicesOffered"]))) {

if(in_array($row_services['categoryLabel'], explode(",", $row_memberDetails["servicesOffered"]))) echo("selected=\"selected\"");

}

?>><?php echo $row_services['categoryLabel']?></option>
<?php
} while ($row_services = mysql_fetch_assoc($services));
$rows = mysql_num_rows($services);
if($rows > 0) {
mysql_data_seek($services, 0);
$row_services = mysql_fetch_assoc($services);
}
?>
</select>



Dropdown code:

<select class="formMenufield_Large" name="region" id="region" rel="<?php echo(WA_coalesce(array(WA_getSavedFormValue("CheckoutWizard_Cool_nzanlp","region"),(isset($_GET["invalid"])?ValidatedField("confirmmcart","region"):"")))); ?>" tabindex="39" title="Please enter a value" required="true">
<option value="" <?php if (!(strcmp("", $row_memberDetails['Region']))) {echo "selected=\"selected\"";} ?>>Please select region</option>
<?php
do {
?>
<option value="<?php echo $row_region['region']?>"<?php if (!(strcmp($row_region['region'], $row_memberDetails['Region']))) {echo "selected=\"selected\"";} ?>><?php echo $row_region['region']?></option>
<?php
} while ($row_region = mysql_fetch_assoc($region));
$rows = mysql_num_rows($region);
if($rows > 0) {
mysql_data_seek($region, 0);
$row_region = mysql_fetch_assoc($region);
}
?>
</select>

I would really appreciate your help on this one while I still have some hair left!

Cheers
Sylvia

Sign in to reply to this post

Ray BorduinWebAssist

Please post ftp information in the private area and the url and steps to reproduce the issue and I'll debug it and get it working for you the way you want.

Sign in to reply to this post

Sylvia

see pm

Sign in to reply to this post

Ray BorduinWebAssist

I updated the test page.... I basically took the value set in the rel property of the select list and used it in replace of the default value (recordset column) you had set as the default in the select list. Then I replaced the "" at the end of the rel value with the recordset value I had replaced.

The finished code is what you see there now.

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