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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:43:55+00:00 2026-06-01T18:43:55+00:00

Why is all the input that is submit blank? (see below). I believe this

  • 0

Why is all the input that is submit blank? (see below). I believe this is due to an error in my JS file.

HTML Form that is getting submitted:

                <form method="post" id="FanDetail">
                        <textarea id="bio" name="fan_bio" cols="27" rows="3"></textarea><br />
                        <input id="dob" name="fan_dob" value="(e.g. 01/05/1965)" onFocus="clearText(this)" /><br />
                        <div class="ui-widget">
                            <input id="zip" name="term" value="What is your Zipcode?" onFocus="clearText(this)" /><br />
                            <input id="actualZip" type="hidden" name="actualzipval" value="" />
                        </div><!--ui-widget :: zip -->
                        <div class="ui-widget">
                            <input id="occup" type="text"  name="term2" value="e.g. Computer Programmer, etc" onFocus="clearText(this)" /><br />
                            <input id="actualOccup" type="hidden" name="actualOccupval" value="" />
                        </div><!--ui-widget :: occup -->
                        <input id="fbkurl" type="text"  name="fan_fbk" value="e.g. SportsFan12" onFocus="clearText(this)" /><br />
                        <input id="twiturl" type="text"  name="fan_twit" value="e.g. AboutSports2012" onFocus="clearText(this)" /><br />
                        <input id="phoNum" type="text"  name="fan_pho" value="cell or home phone" onFocus="clearText(this)" /><br />
                <input style="background-image:url('../../img/save.png');" type="submit" name="saveAbout" value="" id="submit" />
                </form>

The JS file that handles the input from the html form:

$(document).ready(function() {
        $("form#FanDetail").submit(function() {
        // store the values from the form input box, then send via ajax below
        var bio = $('#bio').val();
        var dob = $('#dob').val();
        var zip = $('#actualZip').val();
        var occup = $('#actualOccup').val();
        var fbkurl = $('#fbkurl').val();
        var twiturl = $('#twiturl').val();
        var phoNum = $('#phoNum').val();
        $.post(
                "../../src/php/registration/about/submitvalues_about_tab.php",
                $("form#FanDetail").serialize(),
                function(){
                    $('form#FanDetail').hide(function(){
                        $('div.success').fadeIn();
                });
              });
           return false;
        });
    });

The PHP file I’m using is getting the $fan_sess_id() variable value right, but none of the other inputs are working.

try {
    $sth = null; #kill any possible previous connections
    ///////////////////////////////////////////////
    ######## Get  Input to Submit ############## //
    ///////////////////////////////////////////////
    $fanBio=$_POST['bio'];
    $fanDob=$_POST['dob'];
    $zipval=$_POST['zip'];
    $occupval=$_POST['occup'];
    $facebookurl=$_POST['fbkurl'];
    $twitterurl=$_POST['twiturl'];
    $phoneNum=$_POST['phoNum'];
    //$fanID=1;
    $fan_sess_id = session_id(); // assign $fan_sess_id to the current sessionID

    ### DB Connection already established above.
    $dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );  
    $sth = $dbh->prepare("
    UPDATE Fan 
    SET fanBio='$fanBio',fanDob='$fanDob',fanDetLocID='$zipval',occupID='$occupval',
    fanFbk='$facebookurl',fanTwit='$twitterurl',fanPho='$phoneNum'
    WHERE fansessID='$fan_sess_id';
    ");
    $sth->execute();
}

Finally, this is the output I get when running $sth->debugDumpParams(); in my php script above:

SQL: [152] 
    UPDATE Fan 
    SET fanBio='',fanDob='',fanDetLocID='',occupID='',
    fanFbk='',fanTwit='',fanPho=''
    WHERE fansessID='90707e4c37762a38ffb50883ce64ee1b';
  • 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-01T18:43:57+00:00Added an answer on June 1, 2026 at 6:43 pm

    You need to set the input’s name to the same value you use in your PHP code when accessing $_POST.

    For example:
    In <textarea id="bio" name="fan_bio" cols="27" rows="3"></textarea> change the attribute name to bio to get it’s value as $_POST["bio"].

    When you submit a HTML form, the form element’s name-attribute is used to reference the value, not the id.

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

Sidebar

Related Questions

HTML has an input button type to reset all fields in a form to
I need CSS selector that match all input tags where type is not checkbox
I need to write a simple program that records all the input from parallel
I wish to get the number of all TR elements that have a input
I'm trying to extract all input elements from a form. When I parse the
I want to know if the code below removes all input type='text' values back
I'm trying to get all the input elements from a certain form from jQuery
I have this form with a JS function to verify that there are no
I'm trying to loop over all inputs in my form that are either text
I'm using this jQuery function to jumping on input styled components of the form:

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.