3
 $('form').submit(function(){
            this.action="http://www.sitename.com/post";
            return false;
        });

having altered the action attribute of the form ,i want to add one more input parameter to it how do i do that ?

1 Answer 1

4

Just append an input element:

$('form').append('<input type="hidden" name="newParam" value="Hello" />');
Sign up to request clarification or add additional context in comments.

2 Comments

i tried that but i can't see the hidden parameter in the string produced by form.serialize() .
@Bunny Rabbit: Did you make sure the element had the name attribute? Maybe you could post the whole code that you tried?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.