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 8299195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:04:21+00:00 2026-06-08T16:04:21+00:00

So I cannot understand what is going on entirely. I am using Fancybox to

  • 0

So I cannot understand what is going on entirely. I am using Fancybox to bring up an email submission process. This process gathers information (name, email, etc) and then sends those values via form ‘post’. This php file (mail.php) then takes the values and uses them to populate the appropriate fields to send a mail message. Pretty straight forward, it would seem.

The message sends, however the data I am retrieving from my email submission form doesn’t seem to be there. When I take out the form from the fancybox and just display it plainly on the page it sends the values just fine to the php file, so obviously this has something to do with fancybox.

I don’t fully understand fancybox (haven’t looked over the source) nor have I yielded positive results in searching for a similar problem (perhaps I am just using improper search terms).

Anyways, If anyone could please guide me in the rite direction here, as this is such a frustrating thing to be stalled on.

For reference:

HTML –

  <form id="default-behavior" action="mail.php" method="post">
<div style="display:none">
    <div class="TextCopyright" id="accept" style="width: 700px; font-size: 10px">
        page one
                </br></br><a id="submitClick" href="#submitPage"><button id="conditionButton" type="button" class="submitBtns">I agree to the terms and conditions above</button></a>
    </div>
</div>
<div style="display:none">

        <div id="submitPage">
            <table border="0" cellspacing="0px" class="TextBlock" style="margin-top: 10px" bgcolor="#FFFFFF">
                <tr>
                    <td class="TextBlockOrangeForm"><strong>Name:</strong></td>
                    <td><input type="text" class="formText" name="txtName" id="txtName" style="margin-right:50px"/></td>
                    <td class="TextBlockOrangeForm"><strong>Email:</strong></td>
                    <td><input type="text" class="formText" name="email" id="email"/></td>
              </tr>
                <tr>
                    <td class="TextBlockOrangeForm"><strong>Phone:</strong></td>
                    <td><input type="text" class="formText" name="txtPhone" id="txtPhone"/></td>
                    <td class="TextBlockOrangeForm"><strong>Fax:</strong></td>
                    <td><input type="text" class="formText" name="txtFax" id="txtFax"/></td>
                </tr>
                <tr>
                    <td class="TextBlockOrangeForm"><strong>Address:</strong></td>
                    <td><input type="text" class="formText" name="txtAddress" id="txtAddress"/></td>
                    <td class="TextBlockOrangeForm"><strong>City:</strong></td>
                    <td><input type="text" class="formText" name="txtCity" id="txtCity"/></td>
                </tr>
                <tr>
                    <td class="TextBlockOrangeForm"><strong>Prov/State:</strong></td>
                    <td><input type="text" class="formText" name="txtProv" id="txtProv"/></td>
                    <td class="TextBlockOrangeForm"><strong>Postal/Zip:</strong></td>
                    <td><input type="text" class="formText" name="txtPostal" id="txtPostal"/></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
              </tr>
            </table>
  </br>
            <textarea name="story" class="formText" id="story" style="width:490px; height: 125px">
            </textarea><br>
            <input type="submit" value="Submit Story" id="btnSubmit"/>      
        </div>

</div>
    </form>  

PHP –

$message = $_POST['story']; 

$headers = 'From:' . $from . "\r\n" .
'Reply-To:' . $from . "\r\n" .
'X-Mailer: PHP/' . phpversion();

// now lets send the email. 
mail($to, $subject, $message, $headers); 

echo "Message has been sent....!".$message; 

js –

    $(document).ready(function() {
$("#story").text("");

$("a#inline").fancybox({
    'hideOnContentClick': true,
    'showCloseButton'   : true,
        'autoDimensions': true      
});

$("#submitClick").fancybox({
    'hideOnContentClick': true,
    'showCloseButton'   : true,
        'autoDimensions': true      
});

$("#btnSubmit").click(function () {
    $('#default-behavior').submit();
});
    });        

EDIT
tried with the jquery post method as such and still had the same results (cough, no results):

        $("#btnSubmit").click(function () {
    $.post("mail.php", $("#default-behavior").serialize());
    //$('#default-behavior').submit();
});

and for further confirmation that this is directly related to the fancybox I tried the jquery post with explicit parameters and it sent the data appropriately, ie:

    $("#btnSubmit").click(function () {
    $.post("mail.php", { email: "email@email.com", story: "blah blah test story" });
    //$('#default-behavior').submit();
});
  • 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-08T16:04:22+00:00Added an answer on June 8, 2026 at 4:04 pm

    Ok so problem solved.

    by utilizing the jquery $.post() method I was able to send the form values to the php file.

    Like this:

      $("#btnSubmit").click(function () {
        var ml = $("#email").val();
        var stry = $("#story").val();
    
        $.post("mail.php", { email: ml, story: stry });
    });  
    

    This works for what I need and so has effectively solved the issue. I still have several questions though. Initially I thought that fancybox may be recreating the form elements and putting the ‘cloned’ elements inside the fancybox, so when trying to access the originals, it would only show “” instead of the values input. But by explicitly assigning the elements to a js variable and then sending those variables through post to the .php file (which evidently works), this has me thinking differently (unless there is something in the process I am missing). So I would really love to solve this, figure out why when calling $("element").serialize() it passes empty values.

    For this application, it’s a rather non-important factor – explicitly assigning values is minor because there are so few. However, this can obviously be a huge issue when passing a large number of values to server-side or what not and as such it would really be good to solve this entirely related but separate issue.

    tl;dr – damn you fancybox.

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

Sidebar

Related Questions

Folks, This seems like a basic program and I cannot understand what is going
I cannot understand why the code below is giving me this error in firebug
I cannot understand why this throws undefined reference to `floor' : double curr_time =
I cannot understand why I am getting deadlock in this simple sample.What is wrong
I cannot understand this query? select @:vfOutBalance+@:vfHSSubTotal+@3+orpartpayment,@:vfOutBalance+@:vfHSSubTotal from or_equip_upgrd_id what does @3 mean?
I cannot understand why my compiler (MSVC++2010) doesn't like this code: // get_sum(filename as
I got this hint from mssqlcity.com . However, I cannot understand its explanation. Avoid
I cannot understand what is the difference between: #define WIDTH 10 and int width
I cannot understand why a call to read after an lseek returns 0 number
I cannot understand the calculation 66 ⊕ fa = 9c. The sum is clearly

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.