I have a form with two button .I want to redirect to two different pages when i click these button.On the click event of both buttons i am executing a same function.I want that the function should be executed first then it should be redirected to respective page
2条回答 默认 最新
- douzhantanju1849 2011-08-09 21:11关注
you could change action of form on the fly during submitting (and answer varies depending on using jquery, pure javascript etc.)
but I recommend using php for that task
<input type="submit" value="Edit" class="spare" name="edit"> <input type="submit" value="Send" class="spare" name="send">
and then:
if (isset($_POST['edit'])) ... elseif(isset($_POST['send'])) ...
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报