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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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>
<INPUT style="WIDTH: 48px; HEIGHT: 24px" type=submit size=14 value=Search id=submit1 name=submit1 onClick="fillHidden();load Panel()">
</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!
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>
<INPUT style="WIDTH: 48px; HEIGHT: 24px" type=submit size=14 value=Search id=submit1 name=submit1 onClick="fillHidden();load
</P></TD></TR>
</Form>
<Form name="frm2" action="blah.jsp" method="POST" target="customerInfo" id=frmLDAP>
<input type="hidden" name="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?
ASKER
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.
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.
ASKER
Thanks very much - I hope that clears things up a little.