Jump to content

Help On CheckBox


takeiteasy

Recommended Posts

Sorry! i'm new to Javascript here and would like somebody to explain to me on how the code below works...[code]
<script language="JavaScript">
<!--
function SynchMoves(which) {
  var ml=document.form1;
  if(which==1) {
      ml.select2.selectedIndex=ml.select1.selectedIndex;
  }
  else {
      ml.select1.selectedIndex=ml.select2.selectedIndex;
  }
    }


function submitForm(val){
  document.form1.actionType.value=val;
  document.form1.submit();
}

function valbutton(val1){
   var atleastOneRadioSelected=false;
   //f = document.forms[0];
   f=document.form1;

   f1 = document.forms[1];
   //alert("The value in the 2nd form is"+f.text.value);
   for(i=0;i<f.length;i++){
       var e = f.elements[i];
       if(e.type=="checkbox" && e.checked){
           atleastOneRadioSelected=true;
       }
   }
   //alert("Atleast value "+atleastOneRadioSelected);
   if(!atleastOneRadioSelected) {
       alert("You must select a record to " + val1);
   }else{
       //alert("Do you really want to " +val1+"?");
       var ans1 = "Do you really want to " +val1+"?";
       ans = confirm(ans1);

     if (ans == true) {
        f.actionType.value=val1;
        f.submit();
      } else {
         return false;
     }
         //f.actionType.value=val1;
         //f.submit();
   }
}



//-->
</script>
[/code]
I'm currently doing a PHP project whereby i have 3 buttons, Edit, Delete and Save in my index form.
I have checkbox for checking and when i checked the checkbox, press edit button, it will appear the edit page where it will display the initial records ready for edit.
For the delete, i check the box, press delete and it will prompt me to confirm delete...same goes for the save button.
But now my problem is when i clicked on the edit button for example, it does not produce the edit.php page with all the nesscary details for edit.So how do i go about this?can someone help?! TIA!

[code]
  <input type='checkbox' name='checkbox' value='$empRef'>
   </td>
    <td width='60' bgcolor='$row_color' nowrap>
    $empRef
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.