PDA

View Full Version : Submitting forms / Sending E-Mail



Zuperfly
20 Sep 2006, 4:54 AM
I've managed to display layers via the YUI panels, but I'm having some trouble with the YUI Dialog:

I'd like to use the YUI Dialog to display a form. On klicking 'submit' the form should be sent to an e-mail adress. Displaying the form is no problem (same configuration as the panels), but how do I set up the form's recipient? Do I have to send the form to a separate file for further processing or can I handle the 'mailing' inside the main file itself?

Maybe there are any tutorials or examples on sending mails using the YUI? Thanks!

Animal
20 Sep 2006, 5:10 AM
You're barking up the wrong tree. You need to learn about web development.

Forms are submitted to a server which can process HTTP (google it) messages.

You'll need to write a servlet, some PHP, or whatever .NET has to process the form, and send the email.

I'd recommend using Tomcat, Java, and the Javamail API.

Zuperfly
20 Sep 2006, 5:27 AM
You're barking up the wrong tree. You need to learn about web development.
Well, thanks.


Forms are submitted to a server which can process HTTP (google it) messages. You'll need to write a servlet, some PHP, or whatever .NET has to process the form, and send the email.

Yes, and that's what I'm asking for. With the YUI Dialog, it's possible to submit the form asynchronously (Dynamic XmlHttpRequest), so it's possible to process the form 'inside' the layer in which it is displayed. But I don't know (or where) to specify the recipients adress when I want to send the form via e-mail (and get a confirmation message displayed inside the layer after the mail has been sent).


I'd recommend using Tomcat, Java, and the Javamail API.
Isn't this far too much only for submitting a form? :wink:[/quote]

Zuperfly
20 Sep 2006, 8:01 AM
So for now I've managed to send the form via e-mail by using

{form name="dlgForm" method="POST" action="<php>"}

On submit, the page is sent to itself, the form is processed and the e-mail is sent.

Unfortunately, the YUI dialog layer containing the form is hidden immediately on submit. On submit, I'd like keep the layer and want to display a short feedback message for the user (like "Your mail has been send. Click here to close this window.") instead of the form. Is this possible with the YUI extensions?

jack.slocum
20 Sep 2006, 12:43 PM
Zuperfly,

Try the link below. They are better at these types of questions:

http://tech.groups.yahoo.com/group/ydn-javascript/

Jack

sushmak_bs
10 Apr 2012, 2:29 AM
On submitting the form is processed and email is not sent..
here is the submit button code..

{
xtype: 'button',
text: 'Send',
ui: 'confirm',
handler: function() {



var form = this.up('formpanel');



form.submit({
url:'contact.php',
method:'POST',

success: function() {
Ext.Msg.alert('Thank You', 'Your message has been received', function() {
form.reset();
});
}
});
}
}

and php code..

<?php


$message="$message";




$email="$email";
// From
$header="from: $name <$email>";


// Enter your email address
$to ='[email protected]';


$send_contact=mail($to,$message,$header);


// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information";
}
else {
echo "ERROR";
}
?>

please help me

thanks in advance..