Hi
I want to submit a form to itself first to search and then after checking business logic (checking the input values by query), I want to submit it to another form on the other frame in the same frameset.
I am using
java and javascript to achieve this. Here is my code on the
JSP page. It is skiping the search and directily going to ADD form. I will appreciate if you can give me a hint.
jsp page codes:
<input type="hidden" name="hfAction" value="<%=lsAction%>">
if(!lsContainerNo.equals(null)){
if (lsStatus.equals("")) {
lsMessage = "";
lsAction = "add";
%>
<script language="JavaScript" >
ufAdd();
</script>
<% }
And here is the javascript code
-------------------------------
function ufAdd(){
if (ufValidate()){
if (document.frmEquip.hfAction.value == "search"){
document.frmEquip.submit();
}
else if(document.frmEquip.hfAction.value == "add"){
var loForm = document.frmEquip;
document.frmEquip.action="cm_eq_detail.jsp";
document.frmEquip.target="results";
loForm.submit();
}
}