Hello all - I have created an online form that sends results via email on submit, however, I have 4 checkboxes and their values are coming through as NO no matter what is entered

this is the PHP code

if ($box1 == "on"){
$box1= "Yes";
}else{
$box1 = "No";
}

where have I gone wrong?

thanks

Recommended Answers

All 2 Replies

What are the values you've set for the checkboxes, can you show us the HTML for your checkboxes?

Oh and try to use code tags when your posting code.

I have solved this by removing the attributes

value ""

in the HTML

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.