Response of contact form message does not

So I try to move the place of my response message after the submit button was hit by the user. It happens at the top of the screen, but I want it to appear in a div just below. I read that the use of javascript should work. Here is what ive put:

PHP:

<? PHP

If {($_POST)}

If (! filter_input (INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)) {}

$message = 'Please enter a correct e-mail address' ;} else {}

$fname = strip_tags($_POST['fname']);

$sname = strip_tags($_POST['sname']);

$telephone = strip_tags($_POST['tel']);

$email = $_POST ['email'];

$comments = strip_tags($_POST['comments']);

  $to = ' [email protected] ';

$subject = 'Under contact form.';

$body = $fname. "\n". $sname. "\n". $comments;

$headers = ' from: '. $email;

If (mail ($ $subject, $body, $headers)) {}

echo ' please contact us. We\ will be in contact soon!';

} else {}

$message = ' sorry, an error has occurred. Please try again later.';

}

}}

? >

<? PHP echo "< style p =" color: red "> $message < /p >"? >

Form:

< div class = "contact_form" >
< table class = "table" >

< tbody >

< form id = "contact form" action = "" method = "post" > "

< b >

< scope th 'row' = > name: < /th >

< td > < textarea name = "Pnom" cols = "100" rows = "3" id = "Pnom" > < / textarea > < table >

< /tr >

< b >

< scope = "row" th > family name: < /th >

< td > < textarea name = "sname" cols = "100" rows = "3" id = "sname" > < / textarea > < table >

< /tr >

< b >

< scope th 'row' = > E-mail address: < /th >

< td > < textarea name = "email" cols = "100" rows = "3" id = "email" > < / textarea > < table >

< /tr >

< b >

< scope = "row" th > phone number: < /th >

< td > < textarea name = passes "as" = "100" lines = "3" id = 'this' > < / textarea > < table >

< /tr >

< b >

< scope = "row" th > comments: < /th >

< td > < textarea name = cols 'comments' = "100" lines = '10' id = 'Comments' > < / textarea > < table >

< /tr >

< b >

< scope = "row" th > < /th >

< td = "40px" height > < input type = "submit" > < table >

< /tr >

< b >

< / make >

< /tr >

< / tbody >

< /table >

JavaScript:

"< script type =" text/javascript"src="morris_construction/jquery-1.11.2.min.js "> < / script >

< script >

$("#contactForm").submit (function (event)

{

/ * stop form to submit normally * /.

Event.preventDefault ();

/ * get some values from elements on the page: * /.

var $form = $(this);

$submit = $form.find ("button [type = 'submit']'").

fname_value = $form.find ('input [name = "Pnom"]'). val(),.

sname_value = $form.find ('input [name = 'sname']'). val(),.

tel_value = $form.find ('input [name = 'such']'). val(),.

email_value = $form.find ('entry [name = 'email']'). val(),.

comments_value = $form.find ('textarea [name = 'comments']'). val(),.

URL = $form.attr ('action');

/ * Send data using message * /.

announcement var = $.post (url, {}

fname: fname_value,.

sName: sname_value,.

Tel: tel_value,

E-mail: email_value

Comments: comments_value

});

posting. Done (function (data)

{

/ * Put the results in a div * /.

.html (data) $(«#contactResponse»);

/ * Change the text of the button. */

$submit.text ("' envoys, thanks");

/ * Disable the button. */

$submit.attr ("disabled", true);

});

});

< /script >

< / div > <! - end of the contact form - >

No javascript required or desired for this solution code.

Instead of

echo ' please contact us. We\ will be in contact soon!';

} else {}

echo "sorry, an error occurred. Please try again later.';

}

make variable, like this:

$message = ' please contact us. We\ will be in contact soon!';

} else {}

$message = ' sorry, an error has occurred. Please try again later.';

}

Then, at the location where you want the message to appear...

Tags: Dreamweaver

Similar Questions

  • the simple contact form widget does not allow the user to submit. the lunch box turns red. What should I do?

    the simple contact form widget does not allow the user to submit. the lunch box turns red. What should I do?

    Hello

    You have used a form of e-mail field to create 'Appetite' section. This is the reason for which form registers an error as its not able to recognize an e-mail here entry.

    email form field is a required field for form of Muse. Please rename back to e-mail and also to create another field in form in the widget forum (go to the Option to form and enter a single-line text field) and it should work properly.

    Concerning

    Vivek

  • Contact form displays does not correctly?

    Hello

    I have two contact form on this Web page - the two are not display correctly (the box behind the text is only half the size, and the position on the page is not correct).

    Also - the Facebook and twitter as the buttons at the top of the page move move down on 100px when you load the page - no idea why?

    Help!

    My page link is: http://thededdingtons.businesscatalyst.com/index.html

    A big thank you everyone!

    Hello

    Looks like you have solved the problem. Please let us know if you have another question.

  • Updated my nameservers with GoDaddy and now the Contact form (Muse) does not work. Is there a solution?

    He worked while the site was hosted on Adobe Business Catalyst, but when I updated to direct to my domain on GoDaddy:

    Nameserver 1: NS1.worldsecuresystems.com

    Nameserver 2: ns2.worldsecuresystems.com

    Nameserver 3: NS3.worldsecuresystems.com

    Contact form is no longer the contact sent me. How can I fix it?

    Thank you!

    Thanks Maurice! I changed the address of electronic mail of domain GoDaddy ([email protected]) to my Time Warner email address ([email protected]) and it seems to work.

  • In Outlook Express, when I type in the first letter of an e-mail address that is in my contacts, the dropdown does not close when I click the right address.

    Original title:

    Under XP, when I type in the first letter of an e-mail address that is in my contacts, the dropdown does not close when I click the right address. What a nuisance! Also, when I go to create a new e-mail message, an address of my contacts appears in no particular place, making it impossible to complete the message.

    Hello

    I suggest you turn off Auto complete and then check if you face the same problem.

    a. open Outlook Express.

    b. click on Tools.

    c. click on Options.

    d. click the send tab.

    e. uncheck the e-mail address automatically complete when composing box.

    f. click OK.

    Turn Auto complete and test again to see if the behavior is better. To activate it again, follow the same steps as above, but put a check mark in the box.

  • iMessage old messages does not

    1I # keep all my texts people I regularly text would come back on a convo and I wanted to see what they texted me a month ago, but I was scrolling to the top as I normally do and it stopped at some point and charge more.

    Now, I know I didn't delete the text before this point, and I tried with others and it is letting me go up to a year. I tried force closure of the Messages app and restart my phone and nothing.

    What is odd, is that the person in particular messages does not load after a certain point, but all the pictures/gifs, we sent the other still appear in the "Détails" button

    Advice or people with a similar problem?

    Anyone?

  • Auto form fill does not work in Google

    I updated Firefox to 8.0 days and everything was OK, but today I discovered this forms AutoComplete does not work in google (it works on other sites, however). I checked through form story addon that historical form has not been deleted, it's just the auto form fill that do not work. This happens on both my work and home computer. From FF in safe mode (with extensions disabled) does not help.

    It works to disable JavaScript. Or using the URL http://www.google.com/webhp?complete=0 . Kinda weird, but seems to be the issue of google anyway.

  • message does not come to the main actor

    I send a message to the child actor actor parent. The message does not appear the actor to parent. But if I m using a brakepoint to check then it comes. Can U suggest me a solution that.

    It must be remembered that the kernel running of any actor actor is a clone. You cannot just open the kernel of the actor of a current player for the project and wait until you open the clone who is running, it does not work like that.

  • BlackBerry Smartphones ALT/O command to display the messages does not work on 7.10; Anyone know another shortcut?

    ALT/O command to display the messages does not work on 7.10; Anyone know another shortcut?  I know that I can get all messages sent via Options, but too heavy to do it and then cancel it.

    do an advanced search using the options. Once you are satisfied with it, you can save it and assign it to Alt - O.
    If you do this, remember to remove any other shortcut search which may exist.

  • Error message does not appear

    A login screen I have a Validation. This Validation checks too many failed connection attempts. It works in part because it prevents the user to login when there has been too many attempts to register. But I clear the error message does not appear.

    Display message error location choices are in line with field and in the Notification, in line with the field, Inline in the Notification and error Page. None makes no difference, the error message that I've specified does not appear.

    What can you tell me? Thank you

    Request Express 4.0.2.00.07

    Is what I saw, people by adding an element of the display on the login page to display these error messages...

    Thank you

    Tony Miller
    Los Alamos, NM

  • The controller throws an OAException, but the error message does not appear

    I made a controller to add validation business customized to a specific region of a page of Iprocurement. The controller throws an exception, but the error message does not appear on the page.

    Why when the exception is thrown, the system do not stop the processing of the page and displays the error message?

    I do not know the controller is reached because the page through JDeveloper debugging.

    -PageLayout

    -stackLayout

    -subTabLayout <-my controller is located in this region

    SerializableAttribute public class AccountsDistsValidationCO extends

    {oracle.apps.fnd.framework.webui.OAControllerImpl}

    ' Public Sub processFormRequest (pageContext OAPageContext, OAWebBean webBean)

    {

    super.processFormRequest (pageContext, webBean);

    throw new OAException ("something just happned");

    }

    }

    I should to use the following to solve my problem

    pageContext.putDialogMessage (message);

    pageContext.forwardImmediatelyToCurrentPage (null, true, null);

    Reference:

    OAException.ERROR is not throwing the error

  • When I complete and sign a form and then print it out, the form data does not print.

    When I complete and sign a form and then print it out, the form data does not print. The form fields are empty with the exception of any signature.

    Thank you. Depending on your answer, I have compiled a procedure:

    Fill & sign a form in Adobe CD and print the form fields:

    (1) open the document.

    (2) click on tools - prepare the form. All fields are displayed in a vertical list in the bottom right of the screen.

    3) click on the first field in the list, scroll to the bottom of the list and shift-click to select all.

    4) click on the first field in the document, make a right click, select Properties.

    (5) on the general tab, uncheck the box locked in the lower left corner. Under field properties common form, select Visible and uncheck the read-only box, close.

    (6) print out and save the file.

    Note: even if you select all the fields in the document in step 3, this procedure may work for the fields on page 1. In this case, repeat steps 3 through 5 for each subsequent page.

  • Package oracle.forms.ui does not exist - JCalendar Java Bean - calendar

    Hello

    I tried to change the JCalendarJinit.java file came with the JCalendar, but I was getting errors

    Package oracle.forms.ui does not exist
    Import oracle.forms.ui.VBean;
    ................


    How can I solve this.

    Thanks in advance

    Hello

    You must add the frmall.jar file to your project in JDeveloper. Click the head node of your project, and then choose the submenu project properties, then the node 'Libraries', to add the JAR file.

    François

  • Contact shares at the request of message does not

    I upgraded my ios to 9.3.1 and the contact of message application sharing does not work. I reset my phone, but the problem is not resolved.

    Does anyone have the same problem? How to solve it?

    Can you be a little more specific as to what "market not" actually means? What happens when you try?

  • Contact the Forum does not work on the accommodation of third party (former title now

    I created a site in muse with a simple contact form. When I write the site to a third party host the email filed does not work unless I use my creative cloud email any other email gives me a "the server has encountered an error" when the submit button

    erroer.jpg

    Work with your hosting provider.

    Something is change the generated files from Muse.

    There is more information on troubleshooting the forms here <> .

    The script form_check.php on your site returns the following:

    This strongly implies that something changes the generated files from Muse.

    This page should contain display three lines of text, where at least the first two have green check marks indicating PHP and a sender are configured correctly (as far as Muse can tell). The third green check mark or a red x can be ignored. It refers to SQL, which is optional. The form will work without it.

Maybe you are looking for

  • Unable to update Windows

    I have HP Pavilion p7 desktop PC - 1446 s running 64-bit Windows 8 I keep gettting an error about 98% that says "windows update Setup error" or something very close to that. I'll post a picture, too. I have tried everything I can think of, even a new

  • HP G50-109NR: IDE to AHCI Controller

    Hello I just replaced the WD 120 GB with a SSD Samsung 850 EVO ATA hard drive for my laptop G50-109NR. Is there a way to change the IDE ATA/ATAPI controllers? Thank you Sammy

  • HP Mini 210-3067sz PC: HP Mini 210-3067sz PC 8 characters password BIOS

    Hi Master, My client has, of Switzerland, a laptop HP Mini 210-3067sz PC that will require a password for Admin/market with 8 characters (BIOS messages in Spanish). When inserts wrong move 3 times it shows Sistema desactivado ("System Halt" means) [6

  • Resolution of Windows 7 is terribly lower than previous Vista

    Hi all, I'm very tired right now and I need your help: I have a HP HDX X 16-1155 ca Premium Notebook Pc (which I love) and had Vista on it. I liked a lot and has a resolution of the screen, IF I remember correctly, 1600 x something high. I've been a

  • snapy

    How can I make my k1 more snapy, as when I press on the program, he immediately opens inteads theres like a 5 to 6 seconds of delay. I have currently about 420 MB of free ram did have anything to do with it?