Jquery / Javascript change form action based on input field

前端 未结 4 952
傲寒
傲寒 2021-01-07 02:51

I have a form like this


    
    
4条回答
  •  旧时难觅i
    2021-01-07 03:32

    First get your input, and then update the action. Return true if you want to form to submit after changing the value, or false if these are separate buttons.

    
    
    

    Be careful doing things like this, as if you use this solution you will be opening yourself up to javascript injection attacks. You'll want to "scrub" your input before injecting it into your form.

提交回复
热议问题