469,292 Members | 1,335 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,292 developers. It's quick & easy.

How to pass parameters in document.form.submit()

1
hi,

In my javaScript function iam using

document.ReportListForm.submit(); for form submision

My ReportListForm contains

<form name="RoleListForm" method="Post" action="RIRoleList.do?PageCount=<%= rptBean.getPageCount() %>">

How do i pass parameters in javascript function such that i should able to get value using
request.getParameter("name"); in jsp
Sep 16 '06 #1
1 80593
franks
3
One way to post values in your submission is to include hidden fields in your form and to set these fields with the values that you want to submit in your javascript.

The html would be:

Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" name="yourFieldName" value="">
  2.  
Then in your javascript you can set the value (assuming that there is only one form on the page) using the following code:

Expand|Select|Wrap|Line Numbers
  1. document.forms[0].yourFieldName.value = "yourValue";
  2.  
Sep 18 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

14 posts views Thread by Chris | last post: by
8 posts views Thread by Ed Jay | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.