Solved

selection list seperator?

Posted on 2000-04-21
9
177 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Objects on Same Line 2 29
Not seen Link button 5 38
Java script read and write file - save as location 8 43
Mobile page Scrolling down when refreshing 4 30
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 four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

776 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