PDA

View Full Version : Dynamically add a form field?



alexjewell
11-14-2007, 01:25 AM
I have a form that I would like to become dynamic. Here's the form:

http://alexjewell2.com/clients/quinn/apform.php

It's for a client who is an artist to add an art piece. Where I'd like to add a dynamic element is the Medium field: I'd like an input to show up next to the drop-down list if "other" is selected in that list.

Any ideas or resources?

alexjewell
11-14-2007, 01:56 AM
Nevermind - figured it out. I came up with this script:



function mediumOther(theForm){
show = document.getElementById('other_input');
if (theForm.medium.value=='Other'){
show.style.display='inline';}
else{
show.style.display='none';}
}


If you have any suggestions, let me know...but it works well. Thanks.