Hybrid View

  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    3
    Vote Rating
    0
    Zuperfly is on a distinguished road

      0  

    Default Submitting forms / Sending E-Mail

    Submitting forms / Sending E-Mail


    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!

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,507
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    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.

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    3
    Vote Rating
    0
    Zuperfly is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal
    You're barking up the wrong tree. You need to learn about web development.
    Well, thanks.

    Quote Originally Posted by Animal
    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).

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

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    3
    Vote Rating
    0
    Zuperfly is on a distinguished road

      0  

    Default


    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?

  5. #5
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    Zuperfly,

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

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

    Jack

  6. #6
    Sencha User
    Join Date
    Mar 2012
    Location
    bangalore
    Posts
    14
    Vote Rating
    -1
    sushmak_bs is an unknown quantity at this point

      0  

    Default how to make submit button work..

    how to make submit button work..


    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 ='aaa@gmail.com';


    $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..

Similar Threads

  1. Help: Sending Ext.tree data back to server (ColdFusion)
    By MBragg in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 16 Aug 2007, 7:09 AM
  2. Sending AJAX requests with form contents
    By SteveEisner in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 26 Mar 2007, 10:52 PM
  3. Error sending xml from grid to Server?
    By franklt69 in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 21 Feb 2007, 1:37 PM
  4. onCellUpdated and sending updates back to the server
    By judah in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 4 Oct 2006, 11:52 PM
  5. Drag and drop Yahoo! Mail style
    By jack.slocum in forum Community Discussion
    Replies: 5
    Last Post: 24 Sep 2006, 12:59 AM

Thread Participants: 3