close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Update page not reflecting db values for select menus or checkboxes

Thread began 9/28/2016 3:31 pm by art226587 | Last modified 9/30/2016 2:12 pm by Ray Borduin | 2374 views | 7 replies |

art226587

Update page not reflecting db values for select menus or checkboxes

Hi, I used the DA Pages wizard to create insert, results, update, detail and search pages for a site. All other pages are working correctly except the update page, which populates the text and textarea fields, but doesn't show correct values for checkboxes or select menus.

My text input fields look like this:

<input id="due_date" name="due_date" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("update","due_date"):"".$row_WADAprs_2016["due_date"]."")); ?>" class="formTextfield_Medium" tabindex="2">

My checkboxes like this:

<input type="checkbox" name="comp_needed" id="comp_needed" value="1" class="formCheckboxField_Standard" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("update","comp_needed"):"".$row_WADAprs_2016["comp_needed"].""),"1"))) {echo "checked=\"checked\"";} ?>

I didn't have all of the select menu options when I created the pages, but went back afterward and added them all to my insert and update pages. I realize that this might be an issue, but I'm a novice and haven't the slightest idea where to begin.

Thanks in advance for your help!

Sign in to reply to this post

Ray BorduinWebAssist

Please attach a copy of the page and I can take a look.

Just to confirm: the issue is that the update page doesn't have the correct values selected for checkboxes or select lists but you are sure they are correctly inserted on the insert page. Is that correct?

Sign in to reply to this post
Did this help? Tips are appreciated...

art226587

Hi Ray, That's correct. See my UPDATE post below where I resolved the checkboxes. update page attached. Thanks!

Sign in to reply to this post

art226587

UPDATE: I figured out why my checkboxes weren't populating correctly. I had field the values set to "1" instead of "yes" which is what's in the db. Those are working fine. Now I just need to figure out how to make it select the correct values for the select menus. Any thoughts?

Sign in to reply to this post

Ray BorduinWebAssist

Your select lists don't have the selected value code in them at all.

Highlight your select lists and use the lightning bolt to set the selected value. The value should be set to something like:

<?php echo((isset($_GET["invalid"])?ValidatedField("update","rep"):"".$row_WADAprs_2016["rep"]."")); ?>

Sign in to reply to this post
Did this help? Tips are appreciated...

art226587

Thanks, that was it! I saw that lightning bolt and thought about clicking it, but opted to wait. Everything is selecting the correct options.

Now I have another semi-related question. There are currently three file upload fields on the insert form. Right now I'm just displaying as download links on the update page. I was hoping to display a file upload field if there is no existing file. Is there an easy way to do this? You can see how these fields are set up in the file I sent you.

Thanks again for your help, Ray!

Sign in to reply to this post

Ray BorduinWebAssist

You could use an IF statement to alternatively show the file upload field or link. It might look something like:

php:
<?php

if ($row_WADAprs_2016["fileField"]) { 
?>
link here
<?php
} else {
?>
upload field here
<?php
}
?>
Sign in to reply to this post
Did this help? Tips are appreciated...

art226587

Thanks, Ray. That worked like a charm.

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