Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • While I'll have to try this out and see if it works with my setup, it looks great and I thank you for your help! Commented Jun 22, 2009 at 13:22
  • I just tried implementing the code, but am running into a bit of a problem. That problem being that I want a default input field to be there, but then the drop down menu will give the user the ability to change it. Is there some way to replace the other input field when I run this script? Commented Jun 22, 2009 at 15:36
  • Sure, just create a div using Javascript, like I do the input above. Then create a default input and append it to the div. When the user selects a new input type, empty the div, and append a new inpout of the appropriate type to it. I like to abbreiavte the function to clear a div (or other element) as follows: function rac(obj) { while(obj.hasChildNodes()) obj.removeChild(obj.firstChild); } Commented Jun 22, 2009 at 20:36