close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamic List/Menu values from table

Thread began 1/19/2012 11:01 am by gary.brett434358 | Last modified 1/25/2012 7:32 am by gary.brett434358 | 1750 views | 14 replies |

gary.brett434358

Dynamic List/Menu values from table

Good afternoon,
Using DA wizard I have created insert, update, detail & results pages. On the insert/update pages I should have dynamic List/Menu fields that are populated from another database table.

I can easily enough manually add these fields but is it possible to change the DA created fields to allow the options from another table, which ever one is selected gets written to the table? To test I created a new recordset from TblContactType and built dynamic list from that, now just need to get this into the DA created form & db.

Quick Example:
TblContactType has option1, option2, option3, option4

On the insert/update page the field called ContactType is like this

<div class="rowElem"><label>ContactType:</label><div class="formRight"><input type="text" name="ContactType" id="ContactType" value="" size="32" /></div><div class="fix"></div></div>

I would like this to become a list/menu holding options from TblContactType, then when a user selects Option 4 lets say this is stored in DB table?

Thanks for any advice offered.

Sign in to reply to this post

Jason ByrnesWebAssist

do this when running the data assist wizard.

in the data assist wizard, select the ContactType column, and set the display as option to Menu, click the edit icon to set the menu to be dynamic set the table to use the TblContactType. set the value to the ID column and the label to the name column.

Sign in to reply to this post

gary.brett434358

Originally Said By: Jason Byrnes
  do this when running the data assist wizard.

in the data assist wizard, select the ContactType column, and set the display as option to Menu, click the edit icon to set the menu to be dynamic set the table to use the TblContactType. set the value to the ID column and the label to the name column.  



Again that's great Jason, brilliant support. Have tried this on a test site and all worked great, is there any way I can run this on an existing DA recordset? I have spent best part of 2 days customising the pages created by DA wizard with my own CSS! If I can do this without having to overwrite existing pages it would be fantastic?

Kind regards

Sign in to reply to this post

Jason ByrnesWebAssist

it's a manual process to do it on an existing page.

create a recordset to return the data from the TblContactType table

in design, select the ContactType form element and delete it


insert a select list, make sure to set the name to "ContactType"


in the property inspector, click the dynamic button.

set it tot use the TblContactType recordset, use the ID for the value and the name column for the label.


on the update page, click the lightning bolt next to select value equal to and select the ContactType column from the main recordset (not the TblContactType recordset)

Sign in to reply to this post

gary.brett434358

Originally Said By: Jason Byrnes
  it's a manual process to do it on an existing page.

create a recordset to return the data from the TblContactType table

in design, select the ContactType form element and delete it

in the property inspector, click the dynamic button.

set it tot use the TblContactType recordset, use the ID for the value and the name column for the label.


on the update page, click the lightning bolt next to select value equal to and select the ContactType column from the main recordset (not the TblContactType recordset)  



Will try the manual way in the morning Jason, its late here in UK now. Am I right in thinking the above steps are done in designer view of insert/update pages?

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

yes, that is correct.

Sign in to reply to this post

gary.brett434358

Originally Said By: Jason Byrnes
  yes, that is correct.  



Hmmm, I must be stupid! Have done the manual process, all looks o except the value of the list box doesnt get written to the tblContacts - ContactType column.

I may need to nite the bullet and do it the wizard way then redo all CSS.

Code attached if you have time, if not no problem I appreciate the time you have spent so far.

regards

Attached Files
tblcontacts_Update - Copy.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the update record behavior does not have the contact type column bound to anything.

in the server behaviors panel, double click the Update Record server behavior.

select the ContactType column and click the lightning bolt next to value, bind it to the ContactType form element.

Sign in to reply to this post

gary.brett434358

Originally Said By: Jason Byrnes
  the update record behavior does not have the contact type column bound to anything.

in the server behaviors panel, double click the Update Record server behavior.

select the ContactType column and click the lightning bolt next to value, bind it to the ContactType form element.  



Can you see if that is that now bound? Still doesnt update the ContactType Column in tblContacts?

I am struggling to get my head round this, can you tell?

Sign in to reply to this post

gary.brett434358

Originally Said By: gary.brett434358
  Can you see if that is that now bound? Still doesnt update the ContactType Column in tblContacts?

I am struggling to get my head round this, can you tell?  



Sorry attached now!

Attached Files
tblcontacts_Update - Copy.zip
Sign in to reply to this post
loading

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