form, select onChange=submit()
Здравствуйте. На странице много разных форм и вот одна из них.
Нужно отправить форму при условии <select onChange="this.form.submit()"> К сожалению, this.form.submit(); document.form.myForm.submit()мне подходит. Вопрос: как отправить определенную форму ? Спасибо!
<form name="myForm" id="setDiscont" action='setDiscont.php' method='post''>
<input type="radio" value="<?php print $rowArr['id'];?>" name="id" style="display: none;" checked/>
<select onChange="this.form.submit()">
<?php
echo '<option value="'.$rowArr['discount'].'">'.(int)$rowArr['discount'].'</option>';
for($i=0; $i < 31; $i++){
if($i == 0 && (int)$rowArr['discount'] == 0)
continue;
else
echo '<option value="'.$i.'.00">'.$i.'</option>';
}
?>
</select>
<input type="submit" style="display: none;"/>
</form>
|
Цитата:
document.getElementById('setDiscont').submit();
|
Цитата:
|
niko42,
Ссылку на страницу с траблом |
Цитата:
|
Цитата:
|
Цитата:
|
niko42,
Нужна рабочая тест страничка |
Выдает следующее: Uncaught exception: ReferenceError: Undefined variable: myForm
Error thrown at line 1, column 0 in <anonymous function>(event) in http://test2.ru/order/?id=360: myForm.submit(); |
Цитата:
|
| Часовой пояс GMT +3, время: 18:53. |