Link to home
Start Free TrialLog in
Avatar of smyers2003
smyers2003

asked on

request.parameter doesn't seem to be working - HELP!

Hello everyone,

This is driving me CRAZY - I have a .jsp page which has two forms on it, and I am submitting two forms with the click of one button. Each form is directed towards its own .jsp page, and they will both come back and display correctly in the target page. HOWEVER, each target .jsp page (that I am submitting to from each form), requires the SAME parameter that is being submitted from a txtfield on one of the forms from the original page. No problem grabbing the parameter from the form which CONTAINS the txfield, but I also have a hidden field in my second form (which requires the SAME parameter, and I am presently filling with the original txtfield value using javascript and an onClick() call from the submit button.) Now, when I do an output of request.parameter on each target .jsp page, the first one seems to receive the value ok, while the second one always comes back as empty, null, etc. Is there something that I am overlooking here? Are there any other ways to do this? Any help would be appreciated!  
ASKER CERTIFIED SOLUTION
Avatar of reginab
reginab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smyers2003
smyers2003

ASKER

Hmm - I know, this sounds confusing. Basically, I am filling a hidden field on form2 with the onClick() method. I am then submitting BOTH forms when the user clicks the submit button. When I do a request.parameter("hiddenFormFieldvalue") on form2's target page, it is coming back as null. Everything is working ok for form1 and its target .jsp page.

Thanks very much - I hope that clears things up a little.
I can even SET the "value" attribute of the hdnfield and it is STILL not showing up in the request.parameter of the target page.

Here is the applicable code:
<Form name="frm1" action="search.jsp" method="POST" target="panel1">

.........       

INPUT style="WIDTH: 61px; HEIGHT: 21px" size=3 id=txtSearchTerm name=txtSearchTerm>&nbsp;
<INPUT style="WIDTH: 48px; HEIGHT: 24px" type=submit size=14 value=Search id=submit1 name=submit1 onClick="fillHidden();loadPanel()">
</P></TD></TR>
</Form>

<Form name="frm2" action="blah.jsp" method="POST" target="customerInfo" id=frmLDAP>
<input type="hidden" name="txtLDAPSearchHidden" id="txtLDAPSearchHidden">
</Form>

Thanks very much for any help!
and I am guessing though not assuming then that fillHidden knows the name of frm2, it will need to if it does not. then does the loadpanel fill both targets then?
Reginab,

I was doing some more investigating and it is funny you mentioned loadPanel(). This actually loads the two requested pages into two different sources - one being a single iframe, and another being a set of iframes. Needless to say, tricky to target, especially from a frameset. In any case, an iframe needs a.src, and when I targeted the first iframe with a src (i.e. blah.jsp), it looks as if the call to the iframe .src is STRIPPING the resulting querystring. I figured this out by manually adding a querystring and reloading the targeted .jsp page, and after that it is indeed getting the parameter now. I now have a new problem, but it is .jsp based i nature. I will try to award you these points for at least responding. If you would like to know what the .jsp prob is, I will be placing it in the .jsp forum.
thx, i will check out the jsp.