我正在使用 Javascript 将表单变量传递给 PHP 页面sprcial_action.php
,但它没有重定向到该页面。我的代码如下,请告诉我问题出在哪里?
<script>
function formSubmit(index)
{
var image = document.getElementById("hdnimage" + index);
var email = document.getElementById("email" + index);
window.location.href = "sprcial_action.php?name=" + image;
}
</script>
<form enctype="multipart/form-data" id="form1" name="form1" method="get">
<div class="offers">
<div class="offer-banner">
<img src="/images/specialoffer/offer-1.png" />
</div>
<div class="mobile">
<input type="text" value="Mobile" name="mobile" />
</div>
<div class="or-button"></div>
<div class="email">
<input type="text" value="Email Address" name="email" id="email0" />
</div>
<input type="hidden" name="hdnimage0" id="hdnimage0" value="/images/specialoffer/offer-1.png" />
<div class="redem-copon">
<!--<a href="#"><img src="/images/specialoffer/copun.png" /></a>-->
<input type="image" src="/images/specialoffer/copun.png" onclick="formSubmit(0)" />
</div>
</div>
</form>