QUOTE(Christian J @ May 24 2019, 10:52 PM)
Why not an ordinary data table with links:
CODE
<table border=1>
<tr>
<td></td>
<th>Visit</th>
<th>Meeting</th>
</tr>
<tr>
<th>Entertainment</th>
<td><a href="">Visit Entertainment</a></td>
<td><a href="">Visit Miscellaneous</a></td>
</tr>
<tr>
<th>Miscellaneous</th>
<td><a href="">Meeting Entertainment</a></td>
<td><a href="">Meeting Miscellaneous</a></td>
</tr>
</table>
? The above is easy to understand, and you only need to click one link (as opposed to clicking two radio buttons and one submit button).
If you must use radio buttons, I'd go with PHP (javascript has no advantages). Use a GET form in the default page, and check each querystring combination with IF/ELSE conditions (including one condition for a missing or invalid querystring). Then you could either let the same PHP script generate the different kinds of content, or generate redirect headers to separate pages.
Also, if you use radio button it's good usability practice to give them a default state.
Greetings Christian J.
I tried with your idea of putting in table but it does't look that much good. I tried and tried with lot of available web reference and finally with the following, I got what I desire to have:
<?php
if(isset($_POST['submit1']))
{
$sanfor = $_POST['sanfor'];
$fund = $_POST['fund'];
if ($sanfor == 'visit' && $fund == 'de'){
header('location:insert_sanction.php');
}
if ($sanfor == 'visit' && $fund == 'misc'){
header('location:insert_miscsan.php');
}
if ($sanfor == 'meet' && $fund == 'de'){
header('location:insertmeetingsanform.php');
}
if ($sanfor == 'meet' && $fund == 'misc'){
header('location:insertmiscmeetingform.php');
}
}
?>
<form name="sanopt" id="sanopt" action="sanction_option.php" method="POST">
<h3 class="text-white text-left">Sanction for:</h3><br>
<input type="radio" name="sanfor" id="visit" value="visit"> VISIT
<BR>
<input type="radio" name="sanfor" id="meeting" value="meet"> MEETING
<br>
<br>
<br>
<h3 class="text-white text-left">Fund:</h3><br>
<input type="radio" name="fund" id="defund" value="de"> ENTERTAINMENT
<BR>
<input type="radio" name="fund" id="miscfund" value="misc"> MISCELLANEOUS
<br><br><br>
<center><input class ="btn btn-primary" type="submit" name="submit1" value="SUBMIT"/></center>
</form>
Thank you for all your support and ideas dear friends.