disabling select rows.

liunx

Guest
Hello, a very confused question - I'm sure I've done it before but i can't remember how.<br />
<br />
I have a select box which I'm trying to use for displaying several rows of user details. At the top of this select box I need a row that gives headers for the information below it - I don't want my users (lovely bunch that they are) to be able to click this row at all. How do I do it?<!--content-->this wont disable the click, but rather makes sure that they have chose something on the list.....besides the instructions. Will this work?<br />
<br />
<html><br />
<head><br />
<title>Untitled</title><br />
<script language ="javascript"><br />
function check_it(){<br />
if (document.form1.me.selectedIndex==0){<br />
alert("please make a selection");<br />
document.form1.me.focus();<br />
}else{<br />
alert("no problemo'");<br />
}<br />
}<br />
</script><br />
</head><br />
<body><br />
<form action="" name="form1"><br />
<select name="me" onchange="check_it();"><br />
<option selected value="no">You cant have this</option><br />
<option value="ujm">jhoiubg mboum ,oub m</option><br />
<option value="ikpoli">yn iy niykn mik</option><br />
<option value="iolnh"> yin ikyn mki//vn </option><br />
</select><br />
</form><br />
</body><br />
</html><!--content-->Ah, I doff my cap to you good Doctor. Or something like that - the onChange event was the one I was after - I don't think I'll use the alerts though - I don't like them personally.<br />
<br />
I now have a decent enough looking selection box - the basic idea of which was to recreate a Visual Basic lView but on the web.<br />
<br />
Still, I have other issues - and they are many.<br />
<br />
Lets see if anyone can get this one. Again it's probably simple.<br />
<br />
How do you remove a form field (a standard textbox for example) from the tab order of the form? I can use TabIndex to set the order but not skip a field entirely. Any clues?<br />
<br />
PCheese.<!--content-->Yes, I put the alerts in so you can see the actual result of the script-I usually remove them in a final version. Heres is a solution to your new problem.<br />
<br />
<br />
<html><br />
<head><br />
<title>Untitled</title><br />
</head><br />
<body onload="document.form1.text1.focus();"><br />
<form name="form1"><br><br><br />
<input type="text" name="text1" value="#1"><br><br />
<input type="text" name="text2" value="#2"><br><br />
<input type="text" name="text3" value="#3" disabled onfocus="document.form1.text4.focus();"><br><br />
<input type="text" name="text4" value="#4"><br><br />
</body><br />
</html><!--content-->Once again sir, you have cracked it - This time it was the onFocus bit.<br />
<br />
Is there a reference of which elements of a web page can use which onFocus, onClick (etc) events. I have only really ever seen onClick in use before and have no idea about the correct syntax / usage of any of the others.<br />
<br />
Cheers,<br />
<br />
PCheese.<!--content-->I have a copy of sam's 'pure javascript' and 'HTML, the complete refrence'. I use them quite a bit for stuff like this. Great refrence books, though a little costly. Rather spend your $$$ on beer? Me too! <br />
<br />
Here's a grip o' refrences you can use, free of charge! You can find just about anything you need.........<br />
<br />
<!-- w --><a class="postlink" href="http://www.Volcanic-Design.com/volc_links.htm">www.Volcanic-Design.com/volc_links.htm</a><!-- w --><!--content-->I'll just have to be cheeky and get the boss to buy some new books.<br />
<br />
A nice collection of links you have there though.<br />
<br />
Cheers,<br />
<br />
PCheese.<!--content-->
 
Back
Top