javascript - Simultaneously open mailto and submit form -
at management's request, need open user's email client , submit form on button click. had
window.location = "mailto:email@example.com";
as callback click event submit input, doesn't work. seems form submits quickly.
using window.open
work, creates blank window undesirable.
i had idea prevent , delay form submission in
window.location = "mailto:personalcounselor@gleim.com"; settimeout(function () { $(this).closest('form').trigger('submit'); }.bind(this), 1000); e.preventdefault();
this works, seems sketchy me.
is there way submit form , open mailto link @ same time?
i don't know if work, sure bit of tweaking should work , have desired result after (it long fit in comment, if not work gladly delete it!);
$("form").on("submit", function() { window.onbeforeunload = function() { window.location = "mailto:email@example.com"; }; });
simply put when form submitted, set onbeforeunload
event change location mailto. think doing way make mailto open if form submitted rather when user navigates away.
i don't know if work, or how hacky is, thought throw in 2 cents!
update
on form submit, mailto javascript form values
this seem work , verified others.
$("input[type=submit]").click(function(){ window.location.href = "mailto:email@example.com"; });
Nice Article
ReplyDeletehow to upload multiple files in php and store in database
characteristics of a good program
how to retrieve data from database using ajax without submit
dynamically add remove rows in html table using javascript
arden's theorem
fibonacci series in php
how to fetch data from database in php and display in pdf