javascript - Auto submit or clicked form based on referrer url -


i want make form auto click based on referrer site..

my url http://example.com/from/

<form action="" method="post"> <input name="name" value="jhon" type="text"> <input name="email" value="address@example.com" type="email"> <input name="age" value="28" type="text"> </form> 

what like, when user come url form automatically submitted (auto-clicked). when user comes directly page, or specific site (such own) form not submitted.

is possible this?

try using:

string = document.referrer; 

for more information on this, should see this more information concerning this.

after have gotten url, need decide it. can use document.ready:

$( document ).ready(function() {     //logic }); 

make x has value of "example website" do:

$("#form_id").submit(); 

else nothing.

also, might duplicate of this except user purely needs function run on document being finished. solution needs jquery.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -