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
Post a Comment