missing hidden field

Hello expert ,
I have hidden field in a jsp
<input type="hidden" name="actionRequired"/>

I set the value in a javascript as below

if(validateSearchCriteria())
            {
                   alert("passed validation criteria");
                  if(document.forms["limsRecordAdvancedSearchForm"].elements["useAltSearch"].checked == true)                                 
                        document.forms["limsRecordAdvancedSearchForm"].elements["actionRequired"].value = "ALTERNATESEARCH";
                  /*else if(trimString(document.forms["limsRecordAdvancedSearchForm"].elements["recordNo"].value) != "")
                        document.forms["limsRecordAdvancedSearchForm"].elements["actionRequired"].value = "SINGLERECORD";*/
                  else                                          
                        document.forms["limsRecordAdvancedSearchForm"].elements["actionRequired"].value ="ADVANCEDSEARCH";
                        alert("setting actionRequired as" +actionRequired");
                        document.forms["limsRecordAdvancedSearchForm"].submit();
            }


The filed needs to set itself to ="ADVANCEDSEARCH" which it does , I check it with alert statment ,
but in the action class when i try to read the parameter

actionRequired = request.getParameter("actionRequired");
is get a empty string .
Why would something like this happen , where could i be lossing the data for the hidden field .

plz advice
eldoz12Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tommy BraasCommented:
Post to the JSP TA, this TA is for Java questions.
0
mrigankCommented:
Your form needs to be submitted in Order to propogate the hideen fields to the next request.

Just ensure that your form is getting submitted.

and the code <input type="hidden" name="actionRequired"/>
should be inside

<form>

</form>
0
eldoz12Author Commented:
yea it is between
<html:form>


</html:form>
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

mrigankCommented:
Ensure that the form is submitted to propogate the value of the hidden field.

form.submit is called.
0
colr__Commented:
Use getParameterNames() on the rquest object in your action class to get a list of all the args that are being passed to the servlet.

This should help you debug, remember that java is case sensitive - could that be the problem?

Note also that if the value you are getting is an empty string as opposed to null, then you are probably reading the value correctly at your action class end, which means that the javascipt itself isnt working. If you were trying to read a value that doesnt exist, im pretty sure you would get a null value

colr__
0
mrigankCommented:
Use

<html:hidden property="actionRequired"/>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.