tags:

views:

34

answers:

1
 $('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 ?

+3  A: 

Just append an input element:

$('form').append('<input type="hidden" name="newParam" value="Hello" />');
Andy E
i tried that but i can't see the hidden parameter in the string produced by form.serialize() .
Bunny Rabbit
@Bunny Rabbit: Did you make sure the element had the `name` attribute? Maybe you could post the whole code that you tried?
Andy E