Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Select tag

Quote Reply
Select tag
In my add.html file I have the following
Quote:
<SELECT class=input name=Gender>
<OPTION selected>Female</OPTION>
<OPTION>Male</OPTION>
</SELECT>

The user selects Male but makes an error and goes to the add_error.html page

The select box reverts to default Female.

I tried
Quote:
<SELECT class=input name=Gender VALUE="<%Gender%>">
<OPTION>Female</OPTION>
<OPTION>Male</OPTION>
</SELECT>

But that did not work.

Assuming I want to stil give them the option to make changes, can this be corrected?

Or should I forget about the putting the data in the add_error page and just show the errors with a back button??


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Select tag In reply to
You'll need to use IF conditional statements in the add_error.html template file (the HTML codes you are using are incorrect, BTW).

Like the following:

Quote:

<SELECT name="Gender" class="input">
<OPTION value="Female"<%if Gender eq 'Female'%> SELECTED<%endif%>>Female</OPTION>
<OPTION value="Male"<%if Gender eq 'Male'%> SElECTED<%endif%>>Male</OPTION>
</SELECT>

========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Select tag In reply to
yep, that works. Thanks, I appreciate the help.

I had thought of an if statement but couldn't figure it out.

Is there a way to do that on the non-cgi pages???

you said
Quote:
HTML codes you are using are incorrect, BTW

I had
Quote:
<OPTION>Female</OPTION>

and you had
Quote:
<OPTION value="Female">Female</OPTION>



Are you referring to the lack of value="Female" in mine?

Guess I need to read up on that...

Thanks


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Select tag In reply to
That was one of the problems...earlier versions of Netscape and IE, along with earlier versions of AOL require to have the value attribute. Yes, it will work without the value attribute in later versions of these types of browsers.

Another problem with your HTML was that you can NOT put the SELECTED attribute in the main SELECT anchor (i.e., <SELECT NAME="GetHTMLBook" SELECTED>, like you had in your original post).

Is there a way to do that on the non-cgi pages???

Yea, with javascript.
========================================
Buh Bye!

Cheers,
Me

Last edited by:

Stealth: Sep 3, 2002, 9:53 AM