disable textbox, and enable it onselect options
hi
i am fairly new to javascript
i want to build code for
a by default disabled textbox
and a select option with some dropdown
when i select any option from select then only the textbox should get enabled
what shud i do for this?
thanx
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
function entext()
{
alert(document.f1.selected.value);
document.f1.t1.disabled=false;
}
</script>
</head>
<body>
<form name="f1">
<input type="text" name="t1" disabled>Textbox1<br>
<select name="selected" onChange="entext()">
<option value="In">India</option>
<option value="Us">U.S.A</option>
</select>
</form>
</body>
</html>
thanx, it helped
thanx
i have made a little chanegs in the code, so that it can be run in php
and it's working perfectly
thanx a lot
hai Gaurav,
But your script is not worked in IE 8.0
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks