Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8616289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:34:57+00:00 2026-06-12T05:34:57+00:00

I have a div on a website that when clicked replaces the content of

  • 0

I have a div on a website that when clicked replaces the content of the current page with a form (the form is created with javascript, yes I know it’s weird). It’s a very simple form, a text input a textarea and a button type=submit. On submit, I have it call my php mail page (form.php). Nothing happens. Anyone know why?

Here’s the PHP:

<?php
$to = "theemail@yahoo.com";
$subject = "Someone has contacted you from your website";
$message = $_POST['theMessage'];
$from = $_POST['theEmail'];
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
header( 'Location: http://www.thesite.com/index.php' ) ;
?>

And here’s my js:

var theForm = '\
<from action="../form.php" method="post"> \
    <div class="title blueTxt">Your Email Address:</div>\
    <input type="text" name="theEmail"> \
    <div class="title blueTxt">Your Message:</div>\
    <textarea name="theMessage"></textarea><br> \
    <button type="submit">Send</button>\
    \
</form>';

$('a .callToAction').on('click',function(){
    $('.content').html(theForm);
});

I have tried several things, but they haven’t worked: changing the path for the form.php in the js; using input type=submit as opposed to button. These didn’t work, any ideas? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:34:58+00:00Added an answer on June 12, 2026 at 5:34 am

    It looks like a spelling mistake to me:

    from action…

    Should be:

    form action…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

the div on website below that have search at the bottom and it always
I have two div in my website page one beside the other(one left and
I have a website layout consisting of 4 divs. <div class=global> <div class=content> </div>
Right now on my website I have the following JavaScript that shows and hides
I have a form that when is submited it posts to a div. Ok,
I'm making website that have notification 'button'. When user click this button, notification div
I just downloaded a website template that is in a .PSD form. I have
I have coded a div that is mostly hidden until clicked on where it
In my new website I have a logo that when clicked should return visitors
I have an div element in website markup as follows. <div id=mainContainer class=container runat=server>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.