0

Hi,


I have a submit button in my JSP page. I also have drop down menus and text area in my form. Now my condition is like if drop down values or text area are null in this case if a user wants to submit he should get an alert message to fill the parameters first and it should stay on the same page.

Any suggestions ?

Thanks

4
Contributors
3
Replies
7
Views
6 Years
Discussion Span
Last Post by rakhi4110
0

After you click submit, the page will be passed to the server.

In your server side, do validation routines for your drop downs and text boxes. If there is invalid data, redirect to your original jsp page.

0

Hi,


I have a submit button in my JSP page. I also have drop down menus and text area in my form. Now my condition is like if drop down values or text area are null in this case if a user wants to submit he should get an alert message to fill the parameters first and it should stay on the same page.

Any suggestions ?

Thanks

Go for javascript validation. It will help you to restrict unnecessary server calls.

You will many suggestion and code snippet. Just do some searching in google.

0

You can go for javaScript..
Use onClick attribute for the submit button

For ex:

<form>
<input type="submit" value="submit" onClick="verify()" />
</form>
<script language="javaScript">
function verify()
{
 if(document.form_name.parameter_name.value=="")
 {
  alert('kindly enter all the details');
 }
}
</script>

alternatively instead of checking for each and every parameter you can also use elements... But i'm not very sure about the code snippet.. You can google for it...
Kindly let me know if this was helpful

Edited by __avd: Added [code] tags. Do wrap your programming code blocks within [code] ... [/code] tags

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.