sandhya Posted April 24, 2008 Share Posted April 24, 2008 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 Quote Link to comment Share on other sites More sharing options...
blackcell Posted April 25, 2008 Share Posted April 25, 2008 Not really sure but I think you will needs JS and/or php with ajax assistance. I don't think it can be done purely with html. Quote Link to comment Share on other sites More sharing options...
haku Posted April 25, 2008 Share Posted April 25, 2008 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. Quote Link to comment Share on other sites More sharing options...
zenag Posted April 25, 2008 Share Posted April 25, 2008 <!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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.