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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:19:39+00:00 2026-05-21T16:19:39+00:00

I got this form: <form method=post action= accept-charset=utf-8> <p> <label>first_field</label><br /> <input type=text id=first_field

  • 0

I got this form:

<form method="post" action="" accept-charset="utf-8"> 
<p>
  <label>first_field</label><br />
  <input type="text" id="first_field" name="points[]" /><br />
  <input type="radio" value="inside" name="group_1" checked /><br />
  <input type="radio" value="outside" name="group_1"><br />
</p>
<p>
  <label>second_field</label><br />
  <input type="text" id="second_field" name="points[]" /><br />
  <input type="radio" value="inside" name="group_2" checked /><br />
  <input type="radio" value="outside" name="group_2"><br />
</p>
</form>

What i want to accomplish is to check if inside or outside is checked, if outside i checked the multiply points for the given text input by 1,5. BTW this needs to be calculated in PHP.

How can I do that?

UPDATE

Array
(
[bonus] => Array
    (
        [points] => Array
            (
                [0] => 0
                [1] => 0
                [2] => 0
                [3] => 0
                [4] => 0
                [5] => 0
                [6] => 0
                [7] => 0
                [8] => 0
                [9] => 0
                [10] => 0
                [11] => 0
                [12] => 0
                [13] => 0
                [14] => 0
            )

        [group] => Array
            (
                [0] => inside
                [1] => outside
                [2] => outside
                [3] => inside
                [4] => inside
                [5] => inside
                [6] => inside
                [7] => inside
                [8] => outside
                [9] => inside
                [10] => inside
                [11] => inside
                [12] => outside
                [13] => inside
                [14] => inside
            )

    )

)

Above is the result of print_r($_POST)

Now ho do I compare/pare The points array with the Group array so:

points[0] gets “connected” to group[0] etc.?

  • 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-05-21T16:19:40+00:00Added an answer on May 21, 2026 at 4:19 pm

    As it turns out, you can group fields using HTML forms. Check out this code here: (specifically note the name attributes)

    <form method="post" action="" accept-charset="utf-8">
    <p>
      <label>first_field</label><br />
      <input type="text" id="first_field" name="field[1][points]" /><br />
      <input type="radio" value="inside" name="field[1][group]" checked /><br />
      <input type="radio" value="outside" name="field[1][group]"><br />
    </p>
    <p>
      <label>second_field</label><br />
      <input type="text" id="second_field" name="field[2][points]" /><br />
      <input type="radio" value="inside" name="field[2][group]" checked /><br />
      <input type="radio" value="outside" name="field[2][group]"><br />
    </p>
    </form>
    

    Without filling anything in, this will yield a POST array like this:

    Array
    (
        [field] => Array
            (
                [1] => Array
                    (
                        [points] => 
                        [group] => inside
                    )
    
                [2] => Array
                    (
                        [points] => 
                        [group] => inside
                    )
    
            )
    )
    

    I hope this answered your question, it’s a neat little trick I haven’t really seen many others discuss. One thing to note is that you’ll need to manually specify an ID number in that any set of brackets. You can only use [] as the last set of brackets.

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

Sidebar

Related Questions

I have got this form: <form action='/Admin/Update' method='post'> <input type='text' name='dataUpdate' value= + $temp
i have the following form <form action=ManageLink method=post> <input name=artistName type=text/> <input name=songName type=text/>
I got this code in my submit form <form id=myform action='hello.php' method='GET'> <input type=button
Getting variable from form: <form method = 'POST' action = ''> <input type =
I've got a form that looks like this: <form method=post> {% csrf_token %} <table>
Hey. I've got a login form with post as method. The action goes to
I got this from for a login form tutorial: function sanitize($securitystring) { $securitystring =
Let's imagine I got this: index.php generates form with unpredictable number of inputs with
I've got a block of html code that includes some form action stuff, which
I've got my code to post a javascript array in a form: <form id=my_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.