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

list comparison

Thread began 8/05/2016 9:56 am by Jamie | Last modified 8/08/2016 3:02 pm by Ray Borduin | 78 views | 6 replies |

Jamie

list comparison

Hey Ray

On the attached gallerycat_insert have been trying to get the drop down (line 227) to retain the select on a failed validation. Have tried matching the value to the comparison but I dont think that makes sense as it needs to compare the CategoryID in the table gallery_category against the ProductContentsID from table gallery_category_contents

your advice gratefully received.

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

on line 227 you have:

php:
<option value="<?php echo($GallerySubCat->getColumnVal("CategoryID")); ?><?php if (!(strcmp($GallerySubCat->getColumnVal("ProductContentsID"), (ValidatedField("contentinsert","GallerySubCat"))))) {echo "selected=\"selected\"";} ?>><?php echo($GallerySubCat->getColumnVal("ProductName")); ?></option>


but the comparison has to match the option value, so it should probably be:

php:
<option value="<?php echo($GallerySubCat->getColumnVal("ProductContentsID")); ?><?php if (!(strcmp($GallerySubCat->getColumnVal("ProductContentsID"), (ValidatedField("contentinsert","GallerySubCat"))))) {echo "selected=\"selected\"";} ?>><?php echo($GallerySubCat->getColumnVal("ProductName")); ?></option>
Sign in to reply to this post

Jamie

struggling with this one as I had already tried that (and tried it again) with no luck

not sure what is happening but the db is being updated appropriately depending on the selected option but if I echo the column value to the page its the same value (18) regardless of the item being updated...

Sign in to reply to this post

Ray BorduinWebAssist

Try:
<option value="<?php echo($GallerySubCat->getColumnVal("ProductContentsID")); ?>" <?php if (!(strcmp( $GallerySubCat->getColumnVal("ProductContentsID"), (ValidatedField("contentupdate","GallerySubCat")?ValidatedField("contentupdate","GallerySubCat"):$row_WADAgallery['GalleryPageID'])))) {echo "selected=\"selected\"";} ?>><?php echo($GallerySubCat->getColumnVal("ProductName")); ?></option>

Sign in to reply to this post

Jamie

thats done it! many thanks

I appreciate that the wadagallery records is being referenced, but is actually happening with that addition

:$row_WADAgallery['GalleryPageID']

youve added?

Sign in to reply to this post

Ray BorduinWebAssist

Yes that is so it will use the validated entry when it exists, otherwise it will get the value from the database to show the correct row.

Sign in to reply to this post

Jamie

gotcha thanks

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