Solved

selection list seperator?

Posted on 2000-04-21
9
157 Views
Last Modified: 2010-04-09
<select NAME=\"job_title\" SIZE=\"1\">
                  <option value = \"RTF\">RTF</option>
                  <option value = \"Co-op\">Co-op</option>
                  <option value = \"Intern\">Intern</option>
                  <option value = \"Contract\">Contract</option>
                  <option value = \"Other\">Other</option>
             </select></font>


how to make the selection list with seperator?

thanks!
0
Comment
Question by:syu2
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:hkmdj
ID: 2738073
<select NAME=\"job_title\" SIZE=\"1\">
<option value=\"RTF\">RTF</option>
<option value=\"\">------</optionn>
<option value=\"Co-op\">Coop</option>
<option value=\"\">------</optionn>
<option value=\"Intern\">Intern</option>
<option value=\"\">------</optionn>
<option value = \"Contract\">Contract</option>
<option value=\"\">------</optionn>
<option value = \"Other\">Other</option>
  </select>

Is this what you are talking about?

dj
0
 
LVL 3

Expert Comment

by:davlun20080
ID: 2738332
You can also use:
<option value=\"\">&nbsp;</option>

davlun
0
 

Author Comment

by:syu2
ID: 2738337
sorry dj:

it is not what I want, as I just want
to test if selection != 'RTF'.
if you put that way, it should be as a option, I dont want that way.\


thanks

0
 
LVL 1

Expert Comment

by:hkmdj
ID: 2738344
I will follow along to see what you end up with.  

Good luck!

dj
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 22

Accepted Solution

by:
CJ_S earned 50 total points
ID: 2739612
There is no seperator for a list-box, all you can do is do what is suggested, using an option to pretend to be a seperator.

What you can do so the user can never select a seperator is to use the onChange event, let the onChange event see whether the selected value is a seperator or not, and if it is then select the one right before it, so that'd be like:

<script language=javascript>
<!--

function Check()
{
   //alert(document.form1.selectbox.value)
   if(document.form1.selectbox.value=="SEPERATOR")
      document.form1.selectbox[--document.form1.selectbox.selectedIndex].selected = true

}

//-->
</script>

<form name=form1>

<select name=selectbox onChange="Check()">
<option value="RTF">RTF</option>
<option value="SEPERATOR">------</optionn>
<option value="Co-op">Coop</option>
<option value="SEPERATOR">------</optionn>
<option value="Intern">Intern</option>
<option value="SEPERATOR">------</optionn>
<option value= "Contract">Contract</option>
<option value="SEPERATOR">------</optionn>
<option value = "Other">Other</option>
</select>
</form>

Good luck!
CJ
0
 
LVL 3

Expert Comment

by:davlun20080
ID: 2740367
CJ, that is a good idea.  Never thought of that one.

davlun
0
 

Author Comment

by:syu2
ID: 2743982
although I am not quite satisfiy with the answer, i accept it, thanks!
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2743996
No, thank you!
0
 

Author Comment

by:syu2
ID: 2744209
although I am not quite satisfiy with the answer, i accept it, thanks!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now