We help IT Professionals succeed at work.

Adding Radio Buttons to a form

livewirewebsolutions
on
I have a current form on my website and I want to add about  10 radio buttons at the bottom of the form.  I need the ability to pick more than one radio button and this must be displayed in the email sent to me.  In the code below is my current form.
<form action="contact-us-submit.php" method="post">
				<p>Name <span>*</span></p>

				<input type="text" name="Name" class="info" /><br />

				<p>Phone Number <span>*</span></p>
				<input type="text" name="Phone" class="info" /><br />

				<p>Email Address</p>
				<input type="text" name="Email" class="info" /><br />

				<p>Message:</p>

				<textarea name="Message" value="Your Message" rows="5" cols="40"></textarea><br />

				<input name="Sent" type="submit" id="Sent" value="Send" />

			</form>

Open in new window

Comment
Watch Question

Below is the code that sends the email to me.
<?php

$msg = "Name: " . $_POST['Name'] . "\n";
$msg .= "Email: " . $_POST['Email'] . "\n";
$msg .= "Phone: " . $_POST['Phone'] . "\n";
$msg .= "Message: " . $_POST['Message'] . "\n";

$headers = 'From: ' . $_POST['Email'] . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail("info@example.com", "ITI Contact Form", $msg, $headers);

header("Location: contact-us-thank-you.php", true, 302);

Open in new window

Freelancer
Top Expert 2010
Commented:
if you have to pick more than one radiobutton use checkboxes instead. See the code below. If you can give more info about chackboxes' names and values and how they have to be sent in the messages, I will can be more precise.

Cheers
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
echo "<pre>";
if (isset($_POST['submit'])) {
    if (count($_POST['yourName']) > 0) {
        for ($i = 0; $i < count($_POST['yourName']); $i++) {
            $yourCheckboxes[] = $_POST['yourName'][$i];
        }
        //do any stuff with checkboxes to insert them in your mail system
        var_dump($yourCheckboxes);
    }
}
?>

<form action="contact-us-submit.php" method="post">
				<p>Name <span>*</span></p>

				<input type="text" name="Name" class="info" /><br />

				<p>Phone Number <span>*</span></p>
				<input type="text" name="Phone" class="info" /><br />

				<p>Email Address</p>
				<input type="text" name="Email" class="info" /><br />

				<p>Message:</p>

				<textarea name="Message" value="Your Message" rows="5" cols="40"></textarea><br />
        <input name="yourName[]" type="checkbox" value="yourValue" />
        <input name="yourName[]" type="checkbox" value="yourValue" />
        <input name="yourName[]" type="checkbox" value="yourValue" />
        <input name="yourName[]" type="checkbox" value="yourValue" />
        <input name="yourName[]" type="checkbox" value="yourValue" />
        <input name="yourName[]" type="checkbox" value="yourValue" />
        <input name="yourName[]" type="checkbox" value="yourValue" />
        <input name="yourName[]" type="checkbox" value="yourValue" />
        <input name="yourName[]" type="checkbox" value="yourValue" />
        <input name="yourName[]" type="checkbox" value="yourValue" />
				<input name="Sent" type="submit" id="Sent" value="Send" />

			</form>

Open in new window

to add radio button,

<input type="radio" name="r01" value="val1" />

if you want to have the radio button in a group you have to keep name value same for all button.
eg:
<Input type = 'Radio' Name ='gender' value= 'male'>Male
<Input type = 'Radio' Name ='gender' value= 'female'>Female

if you want to have radio button individual, then name it with unique name

*******************************
to get the value of the radio button,
<?PHP
$gender_val = $_POST['gender'];
echo $gender_val;
?>

you have to do for all 10, if you want to have unique name for each.

also
you can use the if condition if needed. eg.

if ($gender_val = = 'male') {
echo "i am male!!";
}


also there is option to use array if you need to have 10 radio button.
Hi MarqusG,

What is the php code above the form?  It seems to mess with the styling of my form.  When I delete the code above the form the styling is normal.


Commented:
This should work:
<?php

$msg = "Name: " . $_POST['Name'] . "\n";
$msg .= "Email: " . $_POST['Email'] . "\n";
$msg .= "Phone: " . $_POST['Phone'] . "\n";
if(isset($_POST["mycheckbox"])){
	$msg .= "Message: " . $_POST['Message'] . "\n\n" . implode(",", $_POST["mycheckbox"]) . "\n";
}else{
	$msg .= "Message: " . $_POST['Message'] . "\n";
}

$headers = 'From: ' . $_POST['Email'] . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail("info@example.com", "ITI Contact Form", $msg, $headers);

header("Location: contact-us-thank-you.php", true, 302);
?>
<form action="contact-us-submit.php" method="post">
				<p>Name <span>*</span></p>

				<input type="text" name="Name" class="info" /><br />

				<p>Phone Number <span>*</span></p>
				<input type="text" name="Phone" class="info" /><br />

				<p>Email Address</p>
				<input type="text" name="Email" class="info" /><br />

				<p>Message:</p>

				<textarea name="Message" value="Your Message" rows="5" cols="40"></textarea><br />
				<p>Email Address</p>
                <input type="checkbox" name="mycheckbox[]" value="1" /> 1<br />
                <input type="checkbox" name="mycheckbox[]" value="2" /> 2<br />
                <input type="checkbox" name="mycheckbox[]" value="3" /> 3<br />
                <input type="checkbox" name="mycheckbox[]" value="4" /> 4<br />
                <input type="checkbox" name="mycheckbox[]" value="5" /> 5<br />
                <input type="checkbox" name="mycheckbox[]" value="6" /> 6<br />
				<input type="text" name="Email" class="info" /><br />

				<input name="Sent" type="submit" id="Sent" value="Send" />

			</form>

Open in new window

Marco GasiFreelancer
Top Expert 2010

Commented:
Just delete or comment this line:

echo "<pre>";

and your styling will be normal :-)
Hi marqusG,

That worked.  The code below is in another file and seems to control what is sent to the my email.  How do I get it to send the checkbox info as well.  Ie.  I need to know what the user checked.

Another Question about how I complete this section:

<input name="yourName[ ]" type="checkbox" value="yourValue" />

1. What do I replace "yourValue" with?
2. What do I replace "yourName[ ]" with?

ie.  an example of each checkbox would be:

Wire
Cable
Plug
Circuit
<?php

$msg = "Name: " . $_POST['Name'] . "\n";
$msg .= "Email: " . $_POST['Email'] . "\n";
$msg .= "Phone: " . $_POST['Phone'] . "\n";
$msg .= "Message: " . $_POST['Message'] . "\n";

$headers = 'From: ' . $_POST['Email'] . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail("info@example.com", "ITI Contact Form", $msg, $headers);

header("Location: contact-us-thank-you.php", true, 302);

Open in new window

Marco GasiFreelancer
Top Expert 2010

Commented:
Hi.
In the $_POST array only the cheked checkboxes will be present, so you have to give to all checkboxes the same name (for instance productType) with array notation ([], that is productType[] will be the name of each checkbox). The value will be Wire Cable Plug Circuit so we'll have:

 
<form action="contact-us-submit.php" method="post">
<p>Name <span>*</span></p>

<input type="text" name="Name" class="info" /><br />

<p>Phone Number <span>*</span></p>
<input type="text" name="Phone" class="info" /><br />

<p>Email Address</p>
<input type="text" name="Email" class="info" /><br />

				<p>Message:</p><textarea name="Message" value="Your Message" rows="5" cols="40"></textarea><br />
        <input name="productType[]" type="checkbox" value="Wire" />
        <input name="productType[]" type="checkbox" value="Cable" />
        <input name="productType[]" type="checkbox" value="Plug" />
        <input name="productType[]" type="checkbox" value="Circuit" />
	<input name="Sent" type="submit" id="Sent" value="Send" />
</form>

Open in new window


Now see contact-us-submit.php page. Here we're going to grab our checkboxes and put them in our message
<?php

if (isset($_POST['submit'])) {
$msg = "Name: " . $_POST['Name'] . "\n";
$msg .= "Email: " . $_POST['Email'] . "\n";
$msg .= "Phone: " . $_POST['Phone'] . "\n";
$msg .= "Message: " . $_POST['Message'] . "\n";
$msg .= "Choosen prduct types are: " . "\n";
    if (count($_POST['productType']) > 0) {
        foreach ($_POST['productType']) as $key=>$value) {
            $msg .= $value;
        }
    }
$headers = 'From: ' . $_POST['Email'] . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail("info@example.com", "ITI Contact Form", $msg, $headers);

header("Location: contact-us-thank-you.php", true, 302);
}

Open in new window


We have added checkboxes values to our message and sent it to you.

Hope this is clear enough ;-)

Cheers
Most Valuable Expert 2011
Top Expert 2016

Commented:
This explains a little about how checkboxes work.  Much of it applies to radio buttons, too.  But as you know by now checkboxes are the thing you really want.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_5450-Common-Sense-Examples-Using-Checkboxes-with-HTML-JavaScript-and-PHP.html
HI MarqusG,

I updated the code but I am now getting an error on line 10 of the submit page.

I have posted the code on a separate page of the site.  Can you look at it here.

http://itiinternational.com/contact-us2.php

Thanks,
Marco GasiFreelancer
Top Expert 2010

Commented:
Hi livewirewebsolutions. I'm very sorry:

replace this line (emphasis on error)

        foreach ($_POST['productType']) as $key=>$value) {

with this one

        foreach ($_POST['productType'] as $key=>$value) {

I typed an unneeded parenthesis

Cheers
hi marqusG

now i get the error on line 20?
Most Valuable Expert 2011
Top Expert 2016

Commented:
Parse errors, sadly, can only be diagnosed by PHP one at a time.  A script with five parse errors will need to fail (at least) five times for you to get PHP to find them all.  Suggest you post the script as you have it now, and post the exact text of the error message.  We may be able to pick it out visually.
This is what I have now on contact page.  
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
//echo "<pre>";
if (isset($_POST['submit'])) {
    if (count($_POST['productType']) > 0) {
        for ($i = 0; $i < count($_POST['yourName']); $i++) {
            $yourCheckboxes[] = $_POST['yourName'][$i];
        }
        //do any stuff with checkboxes to insert them in your mail system
        var_dump($yourCheckboxes);
    }
}
?>
			
			
<form action="contact-us-submit2.php" method="post">
				<p>Name <span>*</span></p>

				<input type="text" name="Name" class="info" /><br />

				<p>Phone Number <span>*</span></p>
				<input type="text" name="Phone" class="info" /><br />

				<p>Email Address</p>
				<input type="text" name="Email" class="info" /><br />

				<p>Message:</p>

				<textarea name="Message" value="Your Message" rows="5" cols="40"></textarea><br />
                
                <p>What product would you like more information about (please select):</p><br />
                
       <input name="productType[]" type="checkbox" value="Skypatrol Patrolman" /> Skypatrol Patrolman<br />
        <input name="productType[]" type="checkbox" value="Skypatrol Vehicle & Fleet Management" /> Skypatrol Vehicle & Fleet Management<br />
        <input name="productType[]" type="checkbox" value="Skypatrol Asset: Trailer, Flatbed, Chassis, Railcar Tracking and Theft Recovery-Passport" /> Skypatrol Asset: Trailer, Flatbed, Chassis, Railcar Tracking and Theft Recovery-Passport<br />
        
        <input name="productType[]" type="checkbox" value="Skypatrol Buy Here Pay Here BHPH Recovery-Patrolman and Vehicle Management" /> Skypatrol Buy Here Pay Here BHPH Recovery-Patrolman and Vehicle Management<br />
        
        <input name="productType[]" type="checkbox" value="Skypatrol Car Rental and New Car Dealerships" /> Skypatrol Car Rental and New Car Dealerships<br />
        
        <input name="productType[]" type="checkbox" value="Skypatrol Motorcycles, Skidoo, Snowmobile, Boats, Campers, Pleasure Craft, Recreation Vehicles" /> Skypatrol Motorcycles, Skidoo, Snowmobile, Boats, Campers, Pleasure Craft, Recreation Vehicles<br />
        
        <input name="productType[]" type="checkbox" value="Skypatrol Asset Management-Patrolman" /> Skypatrol Asset Management-Patrolman<br />
        
        <input name="productType[]" type="checkbox" value="Skypatrol Construction and Rental Equipment-Patrolman  and Vehicle Management" /> Skypatrol Construction and Rental Equipment-Patrolman  and Vehicle Management<br />
        
        <input name="productType[]" type="checkbox" value="Skypatrol Personal Tracking-Patrolman" /> Skypatrol Personal Tracking-Patrolman<br />
        
        <input name="productType[]" type="checkbox" value="Skypatrol Alzheimer Sufferer and Patient Monitoring & Recovery-Patrolman" /> Skypatrol Alzheimer Sufferer and Patient Monitoring & Recovery-Patrolman<br />
        
				<input name="Sent" type="submit" id="Sent" value="Send" />

			</form>

Open in new window

And this is the submit page
<?php

if (isset($_POST['submit'])) {
$msg = "Name: " . $_POST['Name'] . "\n";
$msg .= "Email: " . $_POST['Email'] . "\n";
$msg .= "Phone: " . $_POST['Phone'] . "\n";
$msg .= "Message: " . $_POST['Message'] . "\n";
$msg .= "Choosen prduct types are: " . "\n";
    if (count($_POST['productType']) > 0) {
        foreach ($_POST['productType'] as $key=>$value) {
            $msg .= $value;
        }
    }
$headers = 'From: ' . $_POST['Email'] . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail("info@itiinternational.com", "ITI Contact Form", $msg, $headers);
//mail("dave@livewirewebsolutions.com", "ITI Contact Form", $msg, $headers);

header("Location: contact-us-thank-you.php", true, 302);

Open in new window

Most Valuable Expert 2011
Top Expert 2016

Commented:
I made as few changes as I could to this.  Experiment with it here on my web server.  Follow the variables and watch how your external input is carried into the action script.
http://www.laprbass.com/RAY_temp_livewire.php
<?php // RAY_temp_livewire.php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);

if (!empty($_POST))
{
    echo "<pre>";
    var_dump($_POST);
    echo "</pre>";

    // SHOW HOW TO FIND THE productType INFORMATION
    foreach ($_POST["productType"] as $key => $value)
    {
        echo "<br/>$key => $value" . PHP_EOL;
    }
}
?>


<form method="post">
				<p>Name <span>*</span></p>

				<input type="text" name="Name" class="info" /><br />

				<p>Phone Number <span>*</span></p>
				<input type="text" name="Phone" class="info" /><br />

				<p>Email Address</p>
				<input type="text" name="Email" class="info" /><br />

				<p>Message:</p>

				<textarea name="Message" value="Your Message" rows="5" cols="40"></textarea><br />

                <p>What product would you like more information about (please select):</p><br />

       <input name="productType[]" type="checkbox" value="Skypatrol Patrolman" /> Skypatrol Patrolman<br />
        <input name="productType[]" type="checkbox" value="Skypatrol Vehicle & Fleet Management" /> Skypatrol Vehicle & Fleet Management<br />
        <input name="productType[]" type="checkbox" value="Skypatrol Asset: Trailer, Flatbed, Chassis, Railcar Tracking and Theft Recovery-Passport" /> Skypatrol Asset: Trailer, Flatbed, Chassis, Railcar Tracking and Theft Recovery-Passport<br />

        <input name="productType[]" type="checkbox" value="Skypatrol Buy Here Pay Here BHPH Recovery-Patrolman and Vehicle Management" /> Skypatrol Buy Here Pay Here BHPH Recovery-Patrolman and Vehicle Management<br />

        <input name="productType[]" type="checkbox" value="Skypatrol Car Rental and New Car Dealerships" /> Skypatrol Car Rental and New Car Dealerships<br />

        <input name="productType[]" type="checkbox" value="Skypatrol Motorcycles, Skidoo, Snowmobile, Boats, Campers, Pleasure Craft, Recreation Vehicles" /> Skypatrol Motorcycles, Skidoo, Snowmobile, Boats, Campers, Pleasure Craft, Recreation Vehicles<br />

        <input name="productType[]" type="checkbox" value="Skypatrol Asset Management-Patrolman" /> Skypatrol Asset Management-Patrolman<br />

        <input name="productType[]" type="checkbox" value="Skypatrol Construction and Rental Equipment-Patrolman  and Vehicle Management" /> Skypatrol Construction and Rental Equipment-Patrolman  and Vehicle Management<br />

        <input name="productType[]" type="checkbox" value="Skypatrol Personal Tracking-Patrolman" /> Skypatrol Personal Tracking-Patrolman<br />

        <input name="productType[]" type="checkbox" value="Skypatrol Alzheimer Sufferer and Patient Monitoring & Recovery-Patrolman" /> Skypatrol Alzheimer Sufferer and Patient Monitoring & Recovery-Patrolman<br />

				<input name="Sent" type="submit" id="Sent" value="Send" />

			</form>

Open in new window

Marco GasiFreelancer
Top Expert 2010

Commented:
Another my typo: in the on-contact-us.php add a } after the last line:
<?php
if (isset($_POST['submit'])) {
    $msg = "Name: " . $_POST['Name'] . "\n";
    $msg .= "Email: " . $_POST['Email'] . "\n";
    $msg .= "Phone: " . $_POST['Phone'] . "\n";
    $msg .= "Message: " . $_POST['Message'] . "\n";
    $msg .= "Choosen prduct types are: " . "\n";
    if (count($_POST['productType']) > 0) {
        foreach ($_POST['productType'] as $key => $value) {
            $msg .= $value;
        }
    }
    $headers = 'From: ' . $_POST['Email'] . "\r\n" .
            'X-Mailer: PHP/' . phpversion();

    mail("info@itiinternational.com", "ITI Contact Form", $msg, $headers);
//mail("dave@livewirewebsolutions.com", "ITI Contact Form", $msg, $headers);

    header("Location: contact-us-thank-you.php", true, 302);
}//ADD THIS

Open in new window


Cheers
Hi Ray,

That seemed to work on your server.   What is the correct code for my site.  I don't know much if anything about php.

Hi MarqusG,

I added the } to the script.  There are now no errors but it just takes me to a blank screen.  Any thoughts??

Thanks!
Most Valuable Expert 2011
Top Expert 2016

Commented:
Hi, Livewire.  We are pretty good about providing answers to questions and examples that illustrate principles, but when it comes to "What is the correct code for my site" there really isn't much we can do.  That is a job for a professional developer.  If you believe as I do that time is money, it would be wise to consider hiring a professional developer to help you get this done in a short amount of time.  If the code has no economic value, and you're just using it as a way to learn PHP, then a more structured learning path might be helpful.  Try these two resources (hint: the SitePoint book is especially valuable!)
http://www.sitepoint.com/books/phpmysql4/
http://us.php.net/tut.php

The "no errors blank screen" syndrome usually arises from suppression of error messages.  To see the error messages, just add these two lines to the top of your script right after <?php

ini_set('display_errors', TRUE);
error_reporting(E_ALL);

Best of luck with your project, ~Ray
Marco GasiFreelancer
Top Expert 2010

Commented:
Absolutely yes! Use error_reporting and ini_set as Ray suggested and post here errors, please. And the email? Has it been sent and received?
Hi marqusG,

I placed the error coding on both the contact and submit pages and nothing happens.  No, I am now not receiving the email.  Maybe I should just pay a developer to quickly fix this issue.

Thanks.
Marco GasiFreelancer
Top Expert 2010

Commented:
You don't have to pay a developer. In contact-us-submit.php replace thia

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

with this

if (isset($_POST['sent'])) {

since 'sent' is the name of your submit form.

Cheers
Marco GasiFreelancer
Top Expert 2010

Commented:
Sorry, use Sent, with the S uppercase. I'm sorry for all these stupid errors... This way it works (tested)
Worked perfectly!

Just one last thing.  I would like a <br /> between each product when it appears in the email.  Currently they are appearing on the same line with no spacing.  See example below.

Name: ss
Email: ss
Phone: sss
Message: ss
Choosen prduct types are:
Skypatrol PatrolmanSkypatrol Vehicle & Fleet Management
Marco GasiFreelancer
Top Expert 2010

Commented:
Replace this

    if (count($_POST['productType']) > 0) {
        foreach ($_POST['productType'] as $key => $value) {
            $msg .= $value;
        }
    }

with this

    if (count($_POST['productType']) > 0) {
        foreach ($_POST['productType'] as $key => $value) {
            $msg .= $value . "\n";
        }
    }

Cheers
:)  Almost.

When I chose 4 products it Put the 1st product on one line and the next three products on the same line??

Thx
Marco GasiFreelancer
Top Expert 2010

Commented:
Perhaps you have a Windows system (like me) so you have to use \r\n instead than \n: I've tested and received this:

Name: marqusG
Email: myemail@here.com
Phone: 3208158058
Message:
Choosen prduct types are:
Skypatrol Patrolman
Skypatrol Vehicle & Fleet Management
Skypatrol Asset: Trailer, Flatbed, Chassis, Railcar Tracking and Theft Recovery-Passport
Skypatrol Buy Here Pay Here BHPH Recovery-Patrolman and Vehicle Management
Skypatrol Car Rental and New Car Dealerships
Skypatrol Motorcycles, Skidoo, Snowmobile, Boats, Campers, Pleasure Craft, Recreation Vehicles

If so, I don't understand why with Name, Email, Phone and Message '\n' only works fine :-o
Weird.  Now the first two appear on different lines and then the remaining are all on the same line.  Any thoughts?

Skypatrol Patrolman
Skypatrol Vehicle & Fleet Management
Skypatrol Car Rental and New Car Dealerships Skypatrol Motorcycles, Skidoo, Snowmobile, Boats, Campers, Pleasure Craft, Recreation Vehicles Skypatrol Construction and Rental Equipment-Patrolman  and Vehicle Management Skypatrol Personal Tracking-Patrolman Skypatrol Security, Police, EMS, Fireman, First Responder-Patrolman Skypatrol Lone Worker, Hiker, Pet Monitoring & Tracking-Patrolman
Marco GasiFreelancer
Top Expert 2010

Commented:
Sorry, but are you using the exact code? Can you repost here contact-us-submit2.php code?
I think so.  See attached.
<?php

ini_set('display_errors', 'TRUE');
error_reporting(E_ALL);

if (isset($_POST['Sent'])) {
$msg = "Name: " . $_POST['Name'] . "\n";
$msg .= "Email: " . $_POST['Email'] . "\n";
$msg .= "Phone: " . $_POST['Phone'] . "\n";
$msg .= "Message: " . $_POST['Message'] . "\n";
$msg .= "I am interested in the following products: " . "\n";
    if (count($_POST['productType']) > 0) {
        foreach ($_POST['productType'] as $key=>$value) {
            $msg .= $value. "\r\n";
        }
    }
$headers = 'From: ' . $_POST['Email'] . "\r\n" .
    'X-Mailer: PHP/' . phpversion();


mail("dave@livewirewebsolutions.com", "ITI Contact Form", $msg, $headers);

header("Location: contact-us-thank-you.php", true, 302);
}

Open in new window

Marco GasiFreelancer
Top Expert 2010

Commented:
Try adding this line to $headers:

$headers .= 'Content-type: text/plain; charset=iso-8859-1' ."\r\n";

See attached:
Marco GasiFreelancer
Top Expert 2010

Commented:
Oooops, forgot the code ;-)
<?php

ini_set('display_errors', 'TRUE');
error_reporting(E_ALL);

if (isset($_POST['Sent'])) {
$msg = "Name: " . $_POST['Name'] . "\n";
$msg .= "Email: " . $_POST['Email'] . "\n";
$msg .= "Phone: " . $_POST['Phone'] . "\n";
$msg .= "Message: " . $_POST['Message'] . "\n";
$msg .= "I am interested in the following products: " . "\n";
    if (count($_POST['productType']) > 0) {
        foreach ($_POST['productType'] as $key=>$value) {
            $msg .= $value. "\r\n";
        }
    }
$headers = 'From: ' . $_POST['Email'] . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
$headers .= 'Content-type: text/plain; charset=iso-8859-1' ."\r\n";

mail("dave@livewirewebsolutions.com", "ITI Contact Form", $msg, $headers);

header("Location: contact-us-thank-you.php", true, 302);
}

Open in new window

Bingo!

Thanks for all your help perseverance.