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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites


<!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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.