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

how to pass a parameter through document.form.action ..?

P: 17
hi friends,
i have 3 buttons 'add','update,'delete' in my jsp what i want is depending on the button name i am trying to do the actoin.

Below i have given my function -----> field i will get my "Button Name"...

My question is how can i send a button name just like a parameter to servlet?
like for ex:
"../Customer?field.name" <--------- is this possible i am getting error is any other ways?

Expand|Select|Wrap|Line Numbers
  1. function CustAction(field){
  2.     var name=field.name;
  3.     var FieldName = document.forms[0].PassportNo.value;
  4.     document.forms[0].method="Post";
  5.     document.forms[0].action="../Customer";
  6.     document.forms[0].submit();
  7. }
  8.  

any kind of help is greatful.
Ajay.
Nov 20 '07 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
Just set a hidden field to this value and the value will be posted with the rest of the form fields.
Nov 20 '07 #2

P: 17
i got the solution

ThanQ Acorder
Nov 21 '07 #3

acoder
Expert Mod 15k+
P: 16,027
You're welcome... glad you got it working.
Nov 21 '07 #4

Post your reply

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