0

I have a problem in Java script when inputting data in html table via selecting from combo box.So any one can solve my problem,please send me code in Java script for restrict repeated data when the period of input.

Thank u

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Gowthamseeda
0

Since i don't have any reference on your code! Then i wil just play a simple example on disabling the list, if you picked them once.

<html>
<head>
<title> <!-- Sample --> </title>
<script type="text/javascript">
<!--
var x = 0;
function a( thisIndex )
{ x = x;  
if ( x >= 0 ) { form1.select.options[thisIndex].disabled = true; form1.select.options[thisIndex].text = 'disabled'; } x++;
var option = form1.select.options;
if ( option[0].disabled && option[1].disabled && option[2].disabled ) {  form1.select.disabled = true; 
 } 
}
document.onchange = function( e ) 
{ e = e ? e : window.event;
  t = e.relatedTarget || e.target ? e.srcElement : e.fromElement; 
if (( t.name ) && ( t.name == 'select' )) { switch( t.selectedIndex ) {
case 0 : a(0); break;
case 1 : a(1); break;
case 2 : a(2); break;
  }
}
}

//-->
</script>
</head> 
<body>
<form name="form1">
<select name="select" size="1">
<option value="">Option 1</option>
<option value="">Option 2</option>
<option value="">Option 3</option>
</select>
</form>
</body>
</html>
0

Hi

Thank you Very much for your reply.I am already solve this with Java script function.In that function i will just perform a if condition with in the for loop.break it when repetition is occurred with in for loop.Any way thank you very much for this. May i know who u are

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.