close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Call JavaScript to Send Email Message

Thread began 5/17/2015 10:23 am by Makubex | Last modified 5/19/2015 5:00 am by Ray Borduin | 421 views | 10 replies |

Makubex

Call JavaScript to Send Email Message

How to trigger Send Email Message by calling JavaScript?

I need Send Email Message to send email triggered by JavaScript behaviors like onClick or onDblClick without insert the record.

Example; in a form, there's email and a message fields, when user double click a button; Send Email Message will send the mail and message to the input email. I want the event is triggered using JavaScript.

OR

How to use Send Email Message with JavaScript and Ajax.

Sign in to reply to this post

Ray BorduinWebAssist

One way to do this is to use a hidden iFrame and set the target of the form to that iframe name. Then you submit the form onclick and send the email from the action page from the form. Since it then loads into the hidden iframe there is no page refresh and it occurs based on the button click.

Sign in to reply to this post

Makubex

Thank you Ray that is a nice idea!

When you say "submit the form onclick" does it mean javascript onclick or form post triggered by input type submit?

Can I set action page current page or leave it blank?

Sign in to reply to this post

Ray BorduinWebAssist

You can create a blank page that just sends an email and use that as the action.

If you use a form input type="image, or type="submit" it will automatically submit the form. Otherwise you can use an image or div with an onclick event and call submit() for the form like: onclick="document.getElementById('formID').submit();"

Sign in to reply to this post

Makubex

That's great, thank you!
So what is event trigger for Send Email Message? Is any from post fine? -If I use javascript submit();

Sign in to reply to this post

Makubex

If my document is HTML5, is it fine to not have action attribute in order Send Email Message to work?

Sign in to reply to this post

Ray BorduinWebAssist

It is fine.. the page will behave as if the action was set to the current page.

Sign in to reply to this post

Makubex

Great! Thanks ;-)

Sign in to reply to this post

Makubex

Ok Ray, one more question. If I use javascript onsubmit event for my form and set in Send Email Message "any from post" to trigger the email message, will it work?

Sign in to reply to this post

Ray BorduinWebAssist

Yes... provided that the form method="post"

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...