Jump to content

Drop down menu


larissahn

Recommended Posts

hi, this question might just be the stupidest ever, but I want to be careful and not mess anything up. this is the code for a drop down menu I have in an application page.

<select name="ProgrammeName" id="ProgrammeName">

<option value="" selected="selected" disabled="disabled">Select Programme</option>

<option value="2-Week" <?php if (!(strcmp("2-Week", KT_escapeAttribute($row_rstblapplication['ProgrammeName'])))) {echo "SELECTED";} ?>>2-Week</option>

<option value="4-Week" <?php if (!(strcmp("4-Week", KT_escapeAttribute($row_rstblapplication['ProgrammeName'])))) {echo "SELECTED";} ?>>4-Week</option>

<option value="8-Week" <?php if (!(strcmp("8-Week", KT_escapeAttribute($row_rstblapplication['ProgrammeName'])))) {echo "SELECTED";} ?>>8-Week</option>

</select>

 

to change from a 2 week to a 3 week option, I just substitute the 3 for a 2, right? I think it is just a string, I'm just not sure what >2-Week</option> at the end of the line is, not calling a variable, right?

Link to comment
Share on other sites

The end of that line represents the actual text the user will see in the drop down list.

 

So if you did this:

<option value="3-Week" <?php if (!(strcmp("2-Week", KT_escapeAttribute($row_rstblapplication['ProgrammeName'])))) {echo "SELECTED";} ?>>2-Week</option>

 

the user would see "2-Week" as an option to select in the drop down but the value behind it that would be used by your program would be "3-Week"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.