Hi,
I am a newbie and have very little knowledge of PHP. I want to create dependencies on links using a checkbox (or any easier tool).
Eg:
Link 1
Link 2
Link 3
If the checkbox on link 2 is clicked, then the link 2 should not be active unless Link 1 in opened. Where as Link 3 should be accessible.
I have written below code:
/* Loop for No. of items/links */
$counter = 0;
foreach ($item as $item_id => $details)
{
if($details['visible'] == 0)
{
continue;
}
$counter++;
/*Checkbox created */
$typec = "Checkbox";
$namec = "formDoor[]";
$valuec = "";
$checking = "<form method=".'POST'.">".
"<input type="."'".$typec."'"."name="."'".$namec."'"."value=".$valuec." />".
"</form>";
/*Dependency condition */
$dsp_ord = '';
$aDoor = $_POST['formDoor'];
$result = "";
if(is_null($aDoor))
{
$result = '<td align="left" valign="top">'.'<a href="#" onClick="javascript:window.open('."'".$url."'". ",'mywindow1','width=1000, height=600'".');">'.$url_name . '</a>' . "</td>\n";
}
else
{
$result = '<td align="left" valign="top">'.'<a href="#">'.$url_name . '</a>' . "</td>\n";
}
With above code the checkbox only appears but doesnt do anything when the page is reloaded, the checkbox is also reloaded. It doesnt get saved.