Forum Moderators: open
I have a select menu, and if the user chooses the alternative "annan", a new input fields shows up where the user can input a value.
This method works fine in safari, but in IE, the added input field doesnt submit to the server side script.
Here is what I have:
javascript:
function moreFields(what,more) {
c = what.options[what.selectedIndex].value;
r = document.getElementById(more);
if (c == "annan") r.innerHTML = ' -> <input name="place" class="input" maxlength="60" type="text" style="width:130px;" />';
}
html:
<select name="place_s" onchange="moreFields(this.form.place_s,'custom_scene',);" class="select" style="width: 150px;">
<option value="">test1</option>
<option value="annan">annan</option>
</select>
<span id="custom_scene"></span>
Now, when I print out the post values from here, using php print_r($_POST) there is no $_POST['place'] value! In safari, there is, but not in IE. Why doesnt the javascript work as it should?
Any reply would be greatly aprechiated.
An Idea: would it be better to use a hidden input field and then just change it to text when the user chooses "annan".? So instead of having a innerHTML, I just change the input type to "text", thus making it editable.
maybe maybe...