Thanks Neeraj and sorry if im not clearing the air.
My project is... every jsp page loads on a command called editCmd. editCmd is the command which will reach a class. So when I click on a link to create a new inventory, the inventory page comes fields(date created, created by,
doc id.. etc). One of its field is a drop down called Order Type.
Now the requirement is, when the user clicks on the create inventory link, the drop down page should appear and then to the corresponding type, the other fields to be populated. I have created the page with the dropdown and the others. The requirement is done. The situation is, i need to include a error message if nothing selected and the go pressed.
1. When the user click create inventory, the jsp to populate the drop down -> editCmd =6 (ie dropdown page).
2. When the user clicks on Go (the form submit action takes to) -> editCmd = 5 ( ie fields page based on the entry in the drop down).
If i have selected null and clicked on Go, all the fields appears with null.
The condition here is, if any error message has to be displayed, it has to be addError method. I did use the javascript to validate the form and stop the action like this,
function fldCheck(){
if(document.frmMain.aa_type.value == ''){
<% uiModule.addError(new Error("Error"));%>
return;
//document.frmMain.action="url";
}
else
{document.frmMain.action=submit;}
}
But my problem is, when the go is clicked, the action takes me to the editCmd value 5. Which means im already in the submitted class. I can control the look of the JSP by the conditions and make the user to see only the drop down. But since im already in the submitted class, i cannot take the drop down value and resubmit again.
I need some information on how to get back to the callee form from the caller from ie after the action submit, if the value is null, i should get back to old form.
I dont have any options to change the editCmd.
Im not sure if im still clear.