Jump to content

inserting a textfield after the onchange or onblur event of another textfield


sandhya

Recommended Posts

 

Hi to all,

        I have a problem with onchange event. Can anybody tell me is it possible to insert a textfield after using the onchange or onblur events while checking the conditions.For exaple, I have a dropdown list and after selecting one field and on change I have to display a textfield in which I can enter the regarding values of the selected field.How can I do it. Anybody Please Help me. Thanks

If it is just a textfield, it should be able to be inserted using only javascript. However PHP or some other server-side language will be needed to process the form after it has been submitted. However, if the possibilities for the text field are numerous, then an ajax solution is probably necessary. Without more information, its hard to say one way or another.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title><script type="text/javascript">
function chang()
{
document.getElementById('box').style.display="block";
}

</script>
</head>

<body >
<select  onchange="chang()"name=""><option value="">1</option><option value="">2</option></select>
<input type="text" name="box" id="box"  style="display:none"  />
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.