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?

[352 byte] By [shida_hadzira] at [2007-10-3 1:33:08]
# 1

<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>

jgalacambraa at 2007-7-14 18:31:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

> 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!

dice7spotsa at 2007-7-14 18:31:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...