problem using if else
if i have this statement
<input type=submit value="submit">
<input type=submit value="edit">
in the form.jsp
how do i write using if else statement,if the user click button submit,it goes to page update.jsp and if the user click edit,it goes to page edit.jsp?
<input type=submit value="submit" onclick="setAction('update')">
<input type=submit value="edit" onclick="setAction('edit')">
<script language="javascript">
function setAction(val){
if(val=='edit'){
document.myform.action ="Edit.jsp";
}else{
document.myform.action ="Update.jsp";
}
}
</script>
> if i have this statement
>
> > <input type=submit value="submit">
> <input type=submit value="edit">
>
>
> in the form.jsp
>
> how do i write using if else statement,if the user
> click button submit,it goes to page update.jsp and if
> the user click edit,it goes to page edit.jsp?
U can use JavaScript code to implement this function!