forms – WordPress plugin getting Boolean values for type=”radio” but only for 2nd member


I have a Wordprss plugin that has a party entry form in it. When the Member1 data is input, I receive name=”amt1″ and “meal1” correctly. But for Member2, the 2 radio fields, “amt2” and “meal2” are received as boolean true false rather than string.
This code works correctly in script outside of the wordpress plugin, so I assume that it is something to do with wordpress, but I am at wits end about what to try next. Also, I am not getting any php errors.

Any ideas about what I am messing up?

 <form method="post" name="myform" action="formProcessing.php">

            <label for="Member1">Member:</label><input type="text" name="Member1" > 
            <label for="amt1">Free:</label>
            <input type="text" name="amt1" value="0.00"><br>      
            <input type="radio" id="A1" name="meal1" value="Lasagne" ><label for="A1">Lasagne</label>&#8195;
            <input type="radio" id="B1" name="meal1" value="Chicken" ><label for="B1">Baked Chicken</label>&#8195;
            <input type="radio" id="C1" name="meal1" value="Beef" ><label for="C1">Beef Tenderloin</label>

            <label for="Member2">Guest:</label> <input type="text" name="Member2">         
            <label for="Member2a">Family-Member-spouse (free)</label> <input type="radio" id="Member2a" name="amt2" value="0.00"> &nbsp;
            <label for="Member2b">family-member ($15)</label> <input type="radio" id="Member2b" name="amt2" value="15.00">
            <label for="Member2c">non-family Guest ($30)</label> <input type="radio" id="Member2c" name="amt2" value="30.00"><br>
            <label for="A2">Crab Cakes</label><input type="radio" id="A2" name="meal2" value="Crab">
            <label for="B2">Chicken Francaise</label><input type="radio" id="B2" name="meal2" value="Chicken" >
            <label for="C2">Pasta Salad</label><input type="radio" id="C2" name="meal2" value="Pasta">
<input type="submit" name="submit" value="submit and pay(if payment is due)">

and the fromProcessing.php

//if (!isset($_POST['submit'])) {

$Member1 = $_POST['Member1'];
$amt1 = $_POST['amt1'];
$meal1 = $_POST['meal1'];

$Member2 = $_POST['Member2'];
$amt2 = isset($_POST['amt2']);
$meal2 = isset($_POST['meal2']);

Narlin 2 years 2021-11-04T14:12:04-05:00 0 Answers 0 views 0

Leave an answer