How to change form target using Javascript?

Well sometime you need that. If you have two submit buttons, one you want to open in the same page and the other on a new one.

Just use this:

document.getElementById(form_id).target= “_blank”;

Hope it helps!

Leave a Reply