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

  • Home
  • SEARCH
  • 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 8246757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:36:40+00:00 2026-06-07T22:36:40+00:00

First off: I’m using the mail script made by Jeffrey Way on In the

  • 0

First off: I’m using the mail script made by Jeffrey Way on In the Woods.

I have a simple form, like so:

<form method="post" action="sendEmail.php" id="form_reserveren">
<div id="container">

    <div id="main" style="width: 100%; height: auto; float: left;">
        <div class="left">
            <h3>Uw gegevens</h3>
            <p style="margin-bottom: 30px; height: 40px; width: 100%;">
                <input type="radio" id="zml_geslacht" name="zml0" value="de Heer"/><span style="float: left; margin-top: -5px; height: 25px;">de Heer</span><br />
                <input type="radio" id="zml_geslacht" name="zml0" value="Mevrouw"/><span style="float: left; margin-top: -5px; height: 25px;">Mevrouw</span>
            </p>
            <p>
                <input type="text" id="zml_voornaam" name="zml1" value="Uw voornaam" onblur="if(this.value=='') this.value='Uw voornaam';" onfocus="if(this.value=='Uw voornaam') this.value='';"/>
                <input type="text" id="zml_achternaam" name="zml2" value="Uw achternaam *" onblur="if(this.value=='') this.value='Uw achternaam *';" onfocus="if(this.value=='Uw achternaam *') this.value='';"/>
            </p>
            <p>
                <input type="text" id="zml_email" name="zml3" value="Uw e-mailadres *" onblur="if(this.value=='') this.value='Uw e-mailadres *';" onfocus="if(this.value=='Uw e-mailadres *') this.value='';"/>
            </p>
        </div>

        <div class="right">
            <h3>Uw reservering</h3>
            <p style="height:68px;">
                <textarea name="zml13" id="zml_opmerkingen" rows="12">Opmerkingen</textarea>
            </p>    


            <p><input type="submit" name="submit" id="submit" value="Email Us!" /></p>
            <ul id="response" />
        </div>
    </div><!--end main -->

</div><!-- end container -->
</form>

This goes through ajax, like so:

var zml0 = $('input#zml_geslacht').html( $(':checked').val());
var zml1 = $('input#zml_voornaam').val();
var zml2 = $('input#zml_achternaam').val();
var zml3 = $('input#zml_email').val();
var zml13 = $('textarea#zml_opmerkingen').val();

$.ajax({
    type: 'post',
    url: 'sendEmail.php',
    data: 'zml0=' + zml0 + '&zml1=' + zml1 + '&zml2=' + zml2 + '&zml3=' + zml3 + '&zml13=' + zml13,

    success: function(results) {
        $('#main img.loaderIcon').fadeOut(1000);
        $('ul#response').html(results);
    }
}); // end ajax

And after that it goes to my sendEmail.php to send the form to an e-mailaddress (and store it in a database). The query is:

 $zml0 = $_REQUEST['zml0']; // Geslacht

    // database connection
$conn = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass);


// query
$sql = "INSERT INTO test (zml0,zml1,zml2) VALUES (:zml0,:zml1,:zml2)";
$q = $conn->prepare($sql);
$q->execute(array(':zml0'=>$zml0,
                  ':zml1'=>$zml1,
                  ':zml2'=>$zml2));

Everthing works.. I also have name, e-mailaddress etc, except for the Gender radio buttons (Gender in Dutch is Geslacht, I name it zml0 to have a little more prevention from spammers). The idea of course is that the user should select Female or Male.

When it gets stored in the database, all it says is [object Object]. Also when I just echo out the input. How can I make this work?

  • 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-07T22:36:42+00:00Added an answer on June 7, 2026 at 10:36 pm

    Try this:

    var zml0 = $('input[name=zml0]:checked').val();
    

    The other thing you could try, which might make your life a little easier for bigger forms is:

    $.ajax({
        type: 'post',
        url: 'sendEmail.php',
        data: $('#form_reserveren').serialize(),
    
        success: function(results) {
            $('#main img.loaderIcon').fadeOut(1000);
            $('ul#response').html(results);
        }
    }); // end ajax
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, I'm using Access 2000 and DAO. I have code that executes a
First off, I am using Windows XP. I have multiple hard drives and it
First off, I would like to make clear, that I am SUPER NEW TO
First off, kudos to the amazing apache cordova team for making a platform-independent native-like
First off, I've never used GWT before. I have good experience in HTML/CSS/JS/JSP. I'm
First off, I'm using XCode 4.0.2. Okay, here is my issue. I can build
First off, I will say i've spent 6 hours on this topic and have
First off I am pretty new to C, so I probably just have a
First off, please accept my apologies if this question is basic, I mainly have
First off I have an app that provides the user information about the amount

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.