CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: onMouseClick

  1. #1
    Join Date
    Sep 2008
    Posts
    13

    onMouseClick

    I have a dynamic generated table that has this format:

    ----------------------------------
    - Column1 - Column2 - Column 3 -
    ----------------------------------
    - - - -
    ----------------------------------
    - - - -
    ----------------------------------
    - - - -
    ----------------------------------
    - - - -
    ----------------------------------
    -
    -
    -
    ----------------------------------
    - - - -
    ----------------------------------

    3 columns, n rows

    Content from Column2:

    Code:
       echo "<td height=\"25px\">";
            if ($status[$user[$i_line]]==0)
                  {
                    echo '<img src="red-status.gif" width="20" height="20">';
                    echo " Disabled";
                  }
            else 
               {
                    echo '<img src="green-status.gif" width="20" height="20">';
                    echo " Enabled";
                    $counter1++;
               }
    Content from Column3:

    Code:
       echo "<td height=\"25px\">";
       if ($status[$user[$i_line]]==0)
    	   echo "<center><form class=\"shell\" name=\"groovyform".$i_line."\"> <input type=\"button\" name=\"groovybtn1\" class=\"groovybutton\" value=\"Enable SecureJailShell\" onMouseOver=\"goLite(this.form.name,this.name)\" onMouseOut=\"goDim(this.form.name,this.name)\"></form></center>";
       else
    	   echo "<center><form class=\"shell\" name=\"groovyform2".$i_line."\"> <input type=\"button\" name=\"groovybtn1\" class=\"groovybutton\" value=\"Disable SecureJailShell\" onMouseOver=\"goLite(this.form.name,this.name)\" onMouseOut=\"goDim(this.form.name,this.name)\"></form></center>";
    
    <script language="javascript">
    function goLite(FRM,BTN){
       window.document.forms[FRM].elements[BTN].style.color = "#CC9900";}
    function goDim(FRM,BTN){
       window.document.forms[FRM].elements[BTN].style.color = "#FFFFCC";}
    </script>
    where:

    Code:
    $counter = 0;
    $counter1 = 0;
    $shell = 0;
    $users = array();
    $value = 0;
    
    while(false !== ($e = $d->read()))
    {
       if ($e != "." && $e != "..")
          $user[] = $e;
          $status[$e] = $shell;
    }
    where $d = dir("..."); (sample)

    I would need some help to imprelement an OnMouseClick action that should do the following:

    Code:
    if value  = Enable SecureJailShell
    	{
    	   change value to Disable SecureJailShell;
               change $status[$user[$i_line]] to 1
    	}
    
    if value  = Disable SecureJailShell
    	{
    	   change value to Enable SecureJailShell;
               change $status[$user[$i_line]] to 0
    	}
    So this action should affect both: the button from Column3, where the action should be added; and the value from Column2

    Could someone please help me?
    Last edited by PeejAvery; November 11th, 2008 at 07:22 PM. Reason: Added code tags.

  2. #2
    Join Date
    Sep 2008
    Posts
    13

    Re: onMouseClick

    I have also attached how my code looks so far, in case you need more details
    Attached Files Attached Files

  3. #3
    Join Date
    May 2002
    Posts
    10,943

    Re: onMouseClick

    I have never used JailShell before, but you are going to have to use some intermediate page which accomplishes the actions. Simply use a hidden iframe to load the following script. Or, you can use AJAX to call it.

    PHP Code:
    <?php
    if ($_GET['jailshell'] == 'enable') {
      
    // enable jailshell
    }
    else {
      
    // disable jailshell
    }
    ?>
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured