By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

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

P: 1

In my javaScript function iam using

document.ReportListForm.submit(); for form submision

My ReportListForm contains

<form name="RoleListForm" method="Post" action="<%= 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
Share this Question
Share on Google+
1 Reply

P: 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="">
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";
Sep 18 '06 #2

Post your reply

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