www.webdeveloper.com
Results 1 to 2 of 2

Thread: JSP: Do not submit form if hidden field is filled

Hybrid View

  1. #1
    Join Date
    Oct 2012
    Posts
    27

    JSP: Do not submit form if hidden field is filled

    Hi. I have a hidden field with name field_hidden in the form to stop spammers. If this field is filled, I want the form to be discarded or not submitted. How to say this in JSP:

    Code:
     if (request.getParameter(field_hidden) != null) {
               do not submit the form
            }
    How does the jsp code go there? Thanks in advance!

  2. #2
    Join Date
    Oct 2012
    Posts
    27
    Got it working like this:

    Code:
    if (hidden_field == "") {
            MailServiceUtil.sendEmail(mailForm);         
    		}
    Last edited by Atrisa Milani; 02-08-2013 at 06:49 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles