html - javascript doesn't work in IE (getElementById) -



html - javascript doesn't work in IE (getElementById) -

i'm using form 2 submit buttons , js 2 functions utilize either one.

<form action="" name="submit" id="step_1_form" method="post" accept-charset="utf-8"> ... <input type="submit" value="speichern & zurück" class="backbutton" form="absenden" name="saveandback" onclick="saveandback()" /> <input type="submit" value="speichern & step 2" class="send" form="absenden" name="saveandfurther" onclick="step2()" /> </form>

js

var form=document.getelementbyid("step_1_form"); function step2() { form.action="step2.php"; form.submit(); } function saveandback() { form.action="scripts/saveandback.php"; form.submit(); }

it works in safari, chrome , firefox, not in ie. may help me find out element makes problem , maybe how solve it? nice. give thanks you!

allright, found solution.

it doens't work in ie, when submit button has same name function. dont' this:

<input type="submit" value="speichern" form="absenden" name="saveandback" onclick="saveandback()" />

better this

<input type="submit" value="speichern" form="absenden" name="anothername" onclick="saveandback()" />

javascript html forms internet-explorer

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -