Solved

selection list seperator?

Posted on 2000-04-21
9
170 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

895 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

15 Experts available now in Live!

Get 1:1 Help Now