Announcement

Announcement Module
Collapse
1 of 2 < >

Custom Support

Slow support on Friday (25), Saturday(26) and Sunday(27). Apologies for the inconvenience.
2 of 2 < >

OFFICIAL MAIL for SUPPORT : support@vibethemes.com

OFFICIAL MAIL for SUPPORT : support@vibethemes.com , Priority support for Forums.
See more
See less

How to Add New field to Contact Form

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Support How to Add New field to Contact Form

    Follow these steps:
    1. Open file custom.js
    2. Search for the on click function i.e line $(".sendmail").click(function () {
    3. You'll see that I am capturing email and the content of the form using these two lines:
    var data = mail;
    var content=$('#contact_text').val();
    To add phone no. also (assuming that you've added the field in html form , add this line below above lines:
    var phone = $('#phone').val();
    now send this phone variable to the send function

    i.e change this line setTimeout(function(){send(data,content);}, 2000); to
    setTimeout(function(){send(data,phone,content);}, 2000);
    4. Now, you need to change the send function, change this line
    function send(datastr,content) {
    to
    function send(datastr,phone,content) {
    5. Now send this phone variable to your php file where it gets captures as phone ($_POST['phone']), change this line
    data: {email:datastr, content: content},
    To
    data: {email:datastr, phone: phone, content: content},

    Then in mail.php capture the post items in variables
    $phone_id= $_POST['phone'] & edit the message content:
    $message = $content."/n/n FROM:".$email_id."/n/n Phone: ".$phone_id;
Working...
X