PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$checked = "no";
if ( $employmentprog <>'')
{
$checked = "yes";
}
if ($businessprog <>'')
{
$checked = 1;
}
if ($certprog <>'')
{
$checked = 1;
}
if ($youthprog <>'')
{
$checked = 1;
}
if ($parentprog <>'')
{
$checked = 1;
}
if ($policyprog <>'')
{
$checked = 1;
}
if ($checked = 'no')
{
echo "Please use your browser to go back and select at least one program.";
}
<SCRIPT LANGUAGE="JavaScript">
function validate(form) {
if (form.my_checkbox.checked==false){
alert("Select a checkbox before continuing");
return (false);
}
}
</script>
<SCRIPT LANGUAGE="JavaScript">
function validate(form) {
if (form.my_checkbox.checked==false){
alert("Select a checkbox before continuing");
return (false);
}
}
</script>
it is a series of checkboxes and I dont know javascript well at all...
$checked = "no";
if (isset($employmentprog)) {
$checked = "yes";
}
if (isset($businessprog)) {
$checked = "yes";
}
if (isset($certprog)) {
$checked = "yes";
}
if (isset($youthprogg)) {
$checked = "yes";
}
if (isset($parentprog)) {
$checked = "yes";
}
if (isset($policyprog)) {
$checked = "yes";
}
if ($checked = 'no')
{
echo "Please use your browser to go back and select at least one program.";
}
$checked = "no";
if (isset($_POST['employment_chkbox'])) {
$checked = "yes";
}
if (isset($_POST['business_chkbox'])) {
$checked = "yes";
}
if (isset($_POST['certification_chkbox'])) {
$checked = "yes";
}
if (isset($_POST['youth_chkbox'])) {
$checked = "yes";
}
if (isset($_POST['parent_chkbox'])) {
$checked = "yes";
}
if (isset($_POST['advocacy_chkbox'])) {
$checked = "yes";
}
if ($checked = "no")
{
echo "Please use your browser to go back and select at least one program.";
}
Maybe this will help (the code in the form that calls this):