How to add input parameter to form using jQuery

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

changing the form action attribute, I want to add another input parameter to it, how to do it?

+3
source share
1 answer

Just add an input element:

$('form').append('<input type="hidden" name="newParam" value="Hello" />');
+4
source

Source: https://habr.com/ru/post/1739460/


All Articles