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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • msg2ajay
    New Member
    • Jun 2007
    • 17

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

    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?

    Code:
    function CustAction(field){
    	var name=field.name;
    	var FieldName = document.forms[0].PassportNo.value;
    	document.forms[0].method="Post";
    	document.forms[0].action="../Customer";
    	document.forms[0].submit();
    }

    any kind of help is greatful.
    Ajay.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Just set a hidden field to this value and the value will be posted with the rest of the form fields.

    Comment

    • msg2ajay
      New Member
      • Jun 2007
      • 17

      #3
      i got the solution

      ThanQ Acorder

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        You're welcome... glad you got it working.

        Comment

        Working...