Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Proble with Droplist properties in Firefox

Status
Not open for further replies.

djRixMix

Programmer
Nov 7, 2002
12
CA
In IE 8.0 The code below works perfectly
In Firefox The code returns an UNDEFINED value for the KEEP property.

Is there a solution to this problem??? :)

===============================================================

<html>
<head>
<title>test</title>
<script type="text/javascript">
function validate_form(thisform){
with (thisform) {
var Occurence = TableId[TableId.selectedIndex];
alert( Occurence.value + " " + Occurence.text + " " + Occurence.keep);
return false }
}
</script>
</head>
<body>
<form method="POST" onSubmit="return validate_form(this)">
<p align= "center">TEST<br/><br/>
<SELECT id= "TableId" name="TableId" size="2">
<option value='1' keep='No' >a</option>
<option value='2' keep='Yes'>b</option>
</SELECT>
</p>
<br/>
<p align= center><input type="submit" value="test"></>
</form>
</body>
</html>
 
Use getAttribute() to access non standard attributes.

Code:
 alert( Occurence.value + "     " + Occurence.text + "     " + Occurence.[red]getAttribute('[green]keep[/green]')[/red]);

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top