Solved

selection list seperator?

Posted on 2000-04-21
9
189 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 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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 …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

749 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