Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

selection list seperator?

Posted on 2000-04-21
9
Medium Priority
?
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

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

Good luck!

dj
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

609 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