Kishan Kumar

Kishan Kumar

  • NA
  • 127
  • 26.4k

How to set up radio button validation in php.

Feb 23 2018 4:21 AM
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$error_msg = array();
if(!isset($_POST['question-1-answers'])){
$error_msg[] = " QNo:1 Not Attemted";
}
if(!isset($_POST['question-2-answers'])){
$error_msg[] = " QNo:2 Not Attemted";
}
if(!isset($_POST['question-3-answers'])){
$error_msg[] = " QNo:3 Not Attemted";
}
if(!isset($_POST['question-4-answers'])){
$error_msg[] = " QNo:4 Not Attemted";
}
if(!isset($_POST['question-5-answers'])){
$error_msg[] = " QNo:5 Not Attemted";
}
if(!isset($_POST['question-6-answers'])){
$error_msg[] = " QNo:6 Not Attemted";
}
if(!isset($_POST['question-7-answers'])){
$error_msg[] = " QNo:7 Not Attemted";
}
if(!isset($_POST['question-8-answers'])){
$error_msg[] = " QNo:8 Not Attemted";
}
if(!isset($_POST['question-9-answers'])){
$error_msg[] = " QNo:9 Not Attemted";
}
if(!isset($_POST['question-10-answers'])){
$error_msg[] = " QNo:10 Not Attemted";
}
else{
alert("R U Submit the form");
}
}
 
 
Please Resolve 
 
Thanks So much.... 
 
 
 

Answers (1)