...

View Full Version : checked functions??



jotcookie
03-08-2005, 07:49 AM
hi all...
i'm having problem in writing codes to select a displayed data from database and then when clicking "Apply", user will be directed to an application form adn they are prompt to fill in the form. i have tried to write the function but it seems that the function did not recognize the variable, so it has not been able to execute. below here are some of my codes:

foreach($row_descp3 as $field_descp3)
{

print("<tr>");
print("<td><input type='checkbox' name='checkbox' value='checkbox'></td>");
print("<td> $rloc3 </td> <td> $rtype3 </td> <td> $rdept3 </td> <td> $rlevel3 </td> <td> $field_descp3 </td>");
print("</tr>");
print "</tr>";

}
--------------------------------------------------------------------------
and this is the function that i tried to write:

<script language="javascript">

function mychecked()
{
var value = false;

if(document.search_php.checkbox.checked)
{
var my_checkbox =document.search_php.checkbox.value;

value = true;
document.location = "dynamicform.php";
}

if(!value)
{
window.alert('Please select one to view');
return false;
}

}

</script>
-------------------------------------------------------------------------
how do i invoke the checked box that i selected(the colored codes) and then make the function work? can anyone help me how to write the codes? need ur help very much...

Kor
03-08-2005, 11:48 AM
you mean to validate? And, what are you going to do with the variable var my_checkbox?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum