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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:36:38+00:00 2026-06-08T15:36:38+00:00

I am trying to make a small form that lets the user pick one

  • 0

I am trying to make a small form that lets the user pick one element from 3 different radiobutton lists to set one element as the users active element (that will be stored to MySQL). Somehow along the way it does not work and I can not seem to figure out why, perhaps someone of you can see what I did wrong?

HTML:

<form name="activeForm1" method="post">
<fieldset data-role="controlgroup">
    <div class="ui-radio">
        <input type="radio" name="active" value="1" id="1">
        <label for="1"></label></input>
    </div>
    <div class="ui-radio">
        <input type="radio" name="active" value="2" id="2">
        <label for="2"></label></input>
    </div>
    <div class="ui-radio">
        <input type="radio" name="active" value="3" id="3">
        <label for="3"></label></input>
    </div>
</fieldset>
<div data-role="footer">
    <input type="submit" href="#" onclick="setActive(1)"/>
</div>
</form>

JavaScript / Ajax call

function setActive(formid) 
    {
            $.ajax(
            {
                type:'POST',
                url:'active.php',
                data:$('#activeForm'+formid).serialize(),
                success:function(response)
                {
                }
            }
        );
    }

PHP code:

session_start();
include('connectToDb.php');
$id = $_SESSION['id'];

if (isset($_POST['active']))
{
    $formValue = $_POST['active'];
    mail('my@mail.com','Test',$formValue,'From: dummy@mail.com');
    mysql_query(/* UPDATE MySQL */);
    header("Location: main.php");
}
else
{
    mail('my@mail.com','Test','No data recieved!','From: dummy@mail.com');
}

So it works up until the if (isset($_POST['active'])) but then mails me that no data was recieved. I already have 2 similar forms on the same page and they are way bigger and has no problems running. Can’t figure out what I did wrong here.

  • 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-08T15:36:44+00:00Added an answer on June 8, 2026 at 3:36 pm

    Wrong code :

      data:$('#activeForm'+formid).serialize(),
    

    #activeForm is not an id, it is the name of the form tag,

    Correct the form tag to,

    <form name="activeForm1" id="activeForm1" method="post">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to make a small project that uses multiple forms (dialogs) for different
I am trying to make a simple Windows Form application that will show different
I'm trying to make a small Python script that is executed by clicking an
I'm trying to make a small program that could intercept the open process of
I'm trying to make a small survey that populates the selections for the dropdown
Basically, what I'm trying to do is simply make a small script that accesses
I am trying to make a small pizza order form, but I have a
I am trying to make a small game like app that has some interaction,
i am trying to make small 3D scene where are 4 pyramids that can
I am trying to make a small app that uses a multiple hierarchy of

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.