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

Update Page - Menu field

Thread began 7/31/2012 10:08 am by iainmacdonald331081 | Last modified 7/31/2012 6:30 pm by iainmacdonald331081 | 535 views | 7 replies |

iainmacdonald331081

Update Page - Menu field

Am just creating an update page using DB, which is working OK. (Especially liking that its not overwriting file names if their not being updated.)

Should I be able to do this for fields input as drop down menus? I can only see to set the input type as a menu, but not to specify the menu items, or make the default the existing value.

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

Data Assist create pages will allow you to use data from a relating table in the menu

in the Configure Field settings section, set the field to display as a menu, then click the lightning bolt to select the table that will be used.

if the list uses static information, you will need to populate it after the page has been created.

Sign in to reply to this post

iainmacdonald331081

Its just static at the moment.

This is how I have it in other pages:

<select name="Country" id="Country" tabindex="5">
<option value="Botswana" <?php if (!(strcmp("Botswana", KT_escapeAttribute($row_WADAitineraries['Country'])))) {echo "SELECTED";} ?>>Botswana</option>
<option value="Kenya" <?php if (!(strcmp("Kenya", KT_escapeAttribute($row_WADAitineraries['Country'])))) {echo "SELECTED";} ?>>Kenya</option>
<option value="Mozambique" <?php if (!(strcmp("Mozambique", KT_escapeAttribute($row_WADAitineraries['Country'])))) {echo "SELECTED";} ?>>Mozambique</option>
<option value="Namibia" <?php if (!(strcmp("Namibia", KT_escapeAttribute($row_WADAitineraries['Country'])))) {echo "SELECTED";} ?>>Namibia</option>
<option value="South Africa" <?php if (!(strcmp("South Africa", KT_escapeAttribute($row_WADAitineraries['Country'])))) {echo "SELECTED";} ?>>South Africa</option>
<option value="Tanzania" <?php if (!(strcmp("Tanzania", KT_escapeAttribute($row_WADAitineraries['Country'])))) {echo "SELECTED";} ?>>Tanzania</option>
<option value="Uganda" <?php if (!(strcmp("Uganda", KT_escapeAttribute($row_WADAitineraries['Country'])))) {echo "SELECTED";} ?>>Uganda</option>
<option value="Zambia" <?php if (!(strcmp("Zambia", KT_escapeAttribute($row_WADAitineraries['Country'])))) {echo "SELECTED";} ?>>Zambia</option>
<option value="Zimbabwe" <?php if (!(strcmp("Zimbabwe", KT_escapeAttribute($row_WADAitineraries['Country'])))) {echo "SELECTED";} ?>>Zimbabwe</option>
</select>



But here that is just killing the code - the menu list isn't populated, and no content after the menu list is appearing.

Sign in to reply to this post

Jason ByrnesWebAssist

ok, using static values, you have to populate the list after the page is created.

in design view, select the menu, then Click the Dynamic Button in the property inspector.

Populate the list with static options, then for the Select Value equal to setting, click the lightning bolt and select the countries column from the recordset.

Sign in to reply to this post

iainmacdonald331081

That gives me:

<select name="Country" id="Country" tabindex="5">
<option value="Botswana" <?php if (!(strcmp("Botswana", $row_WADAitineraries['Country']))) {echo "selected=\"selected\"";} ?>>Botswana</option>
<option value="Kenya" <?php if (!(strcmp("Kenya", $row_WADAitineraries['Country']))) {echo "selected=\"selected\"";} ?>>Kenya</option>
<option value="Mozambique" <?php if (!(strcmp("Mozambique", $row_WADAitineraries['Country']))) {echo "selected=\"selected\"";} ?>>Mozambique</option>
<option value="Namibia" <?php if (!(strcmp("Namibia", $row_WADAitineraries['Country']))) {echo "selected=\"selected\"";} ?>>Namibia</option>
<option value="South Africa" <?php if (!(strcmp("South Africa", $row_WADAitineraries['Country']))) {echo "selected=\"selected\"";} ?>>South Africa</option>
<option value="Tanzania" <?php if (!(strcmp("Tanzania", $row_WADAitineraries['Country']))) {echo "selected=\"selected\"";} ?>>Tanzania</option>
<option value="Uganda" <?php if (!(strcmp("Uganda", $row_WADAitineraries['Country']))) {echo "selected=\"selected\"";} ?>>Uganda</option>
<option value="Zambia" <?php if (!(strcmp("Zambia", $row_WADAitineraries['Country']))) {echo "selected=\"selected\"";} ?>>Zambia</option>
<option value="Zimbabwe" <?php if (!(strcmp("Zimbabwe", $row_WADAitineraries['Country']))) {echo "selected=\"selected\"";} ?>>Zimbabwe</option>
</select>



But its when I go to the update page, it defaults to the first on the list, ie Botswana, rather than the current value for the record.

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the page please so i can see the entire page code.

Sign in to reply to this post

iainmacdonald331081

Its working now, thanks Jason.

Sign in to reply to this post

iainmacdonald331081

Ignore this.

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