close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dropdown Problem - Dataassist

Thread began 7/29/2011 11:22 am by steve150290 | Last modified 7/29/2011 12:28 pm by Jason Byrnes | 2258 views | 7 replies |

steve150290

Dropdown Problem - Dataassist

I have a database that I set up using dataassist, on the 'update' page, I have 4 items with dropdown choices (Yes/No, State these are dynamic dropdowns), my problem is that about half the time the update page will correctly show the contents of the existing record and other times just the defaults. How can I get it to work all the time? This is a .asp page by the way. Thanks in Advance for any help

Sign in to reply to this post

Jason ByrnesWebAssist

please send a copy of the page so i can look at the code to determine how to trouble shoot this issue.

Sign in to reply to this post

steve150290

Page Code

Page Code attached. Thank YOu

Attached Files
Trainers_Update.pdf
Sign in to reply to this post

Jason ByrnesWebAssist

OK, lets take the state list for example.

the code that writes each option for the state list is:

<option value="<%=(WADADynListSystemOptions.Fields.Item("OptionValue").Value)%>" <%If (Not i
sNull((WADATrainers.Fields.Item("State").Value))) Then If (CStr(WADADynListSystemOptions.Fields.Item("O
ptionValue").Value) = CStr((WADATrainers.Fields.Item("State").Value))) Then Response.Write("selected=""sel
ected""") : Response.Write("")%>
209 ><%=(WADADynListSystemOptions.Fields.Item("DisplayName").Value)%></option>




to troubleshoot the cause of the problem, we need to know the values of the two columns being compared changing the statte list code to:

<option value="<%=(WADADynListSystemOptions.Fields.Item("OptionValue").Value)%>" <%If (Not i
sNull((WADATrainers.Fields.Item("State").Value))) Then If (CStr(WADADynListSystemOptions.Fields.Item("O
ptionValue").Value) = CStr((WADATrainers.Fields.Item("State").Value))) Then Response.Write("selected=""sel
ected""") : Response.Write("")%>
209 ><%=(WADADynListSystemOptions.Fields.Item("DisplayName").Value)%>|<%=(WADADynListSystemOptions.Fields.Item("O
ptionValue").Value)%>|<%=(WADATrainers.Fields.Item("State").Value)%>|</option>



will show those values in the list to help us determine what is causing the problem.

Sign in to reply to this post

steve150290

Codes

The 'states' os using the Option Value and the Display name
The yesNo is using display and Value1

Attached Files
SelectYesNo.pdf
SystemOptions.pdf
Sign in to reply to this post

Jason ByrnesWebAssist

For the state select list:
if you look at the source code for the state select list, there is a lot pf blank space at the end of each options, example:
<option value="AL " >Alabama</option>

this is causing the comparison to compare the string "AL " to "AL" which are not the same, this is causing the state lit not to pre select the correct option. you need to remove the space at the end of each state abbreviation from the database table.

for the other select lists, it seams the no "-" option is working correctly, it is the "Yes" option that is not working.

this is due to case, in the main table it is storing yes as "Yes", on the option ttable is is storing yes as "YES"

The 2 strings:
Yes
YES

are not the same due to case differences.

Sign in to reply to this post

steve150290

That fixed it!
This was my first experience with using dynamic dropdowns and I did not even consider the database for the dropdowns being the problem. I changed the field to 2 for state and 4 for yes/no and made the yes/no all the same case. Thank yu So very much!

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