My topic was already posted in the PHP form, but apparently this is no longer a PHP issue. More of a Javascript one now :-/

http://www.fhhsbandhome.com/authalpha/forms.php is my page

On post by clicking an image:

POSTDATA=username=username&password=password&imagename=Image+Name&imageid=00&imageid.x=19&imageid.y=51

Image ID is still the same, 00 so it's not working. It's just using the hidden value I set. Also I was wondering if you think I need or If I can get rid of these stupid x y coordinates ( &imageid.x=19&imageid.y=51) If you know how to get rid of em post a code example below. I'm guessing this is a Javascript issue. On submit that javascript function is susppose to change my hidden 00 value to the number clicked, but it's not. I defiantly need some help with this

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
    <script type="text/javascript">
    function SendTo(id){
        //shortening form elements
        var myForm      = document.getElementById('myForm');
        var image_id = document.getElementById('imageid');

    imageid.value = id;

    myForm.submit();            

    }
    </script>

        </head>
<body>

<div id="container">
  <div id="top">
    <h1>Please complete the form bellow</h1>
  </div>
  <div id="leftSide">
  <fieldset>
<legend>Login details</legend>
We have added another layer of security to protect your accounts. <div style="clear:both;"></div>
To login:<div style="clear:both;"></div>
    1: Enter your username and password<div style="clear:both;"></div>             
2: Enter a name for one of the pictures on the right. <div style="clear:both;"></div> 3: Click on that picture.<div style="clear:both;"></div> Each time you login after the first time, you will need to enter the same picture name and click on the same picture.</font> <br /> <div style="clear:both;"></div> <form name="myForm" id="myForm" action="forms.php" method="post" class="form"> <label for="username">Username</label> <div class="div_texbox"> <input name="username" type="text" class="username" id="username" value="username" /> </div> <label for="password">Password</label> <div class="div_texbox"> <input name="password" type="password" class="password" id="password" value="password" /> </div> <label for="imagename">Image Name</label> <div class="div_texbox"> <input name="imagename" type="text" class="imagename" id="imagename" value="Image Name" /> </div> <div class="clear"></div> </fieldset> <hr size="1" /> </div> <div id="rightSide"> <p>Confused? Submit your login by clicking on your picture below.</p> <p id="flagbar"> <!--begin submit login images--> <input type='hidden' name='imageid' id='imageid' value='00'/> <input type='image' src='images/securitypics/01.jpg' name='imageid' id='01' onClick="SendTo(01)"/> <input type='image' src='images/securitypics/02.jpg' name='imageid' id='01' onClick="SendTo(02)"/> <input type='image' src='images/securitypics/03.jpg' name='imageid' id='03' onClick="SendTo(03)"/> <input type='image' src='images/securitypics/04.jpg' name='imageid' id='04' onClick="SendTo(04)"/> <input type='image' src='images/securitypics/05.jpg' name='imageid' id='05' onClick="SendTo(05)"/> <input type='image' src='images/securitypics/06.jpg' name='imageid' id='06' onClick="SendTo(06)"/> <input type='image' src='images/securitypics/07.jpg' name='imageid' id='07' onClick="SendTo(07)"/> <input type='image' src='images/securitypics/08.jpg' name='imageid' id='08' onClick="SendTo(08)"/> <input type='image' src='images/securitypics/09.jpg' name='imageid' id='09' onClick="SendTo(09)"/> <input type='image' src='images/securitypics/10.jpg' name='imageid' id='10' onClick="SendTo(10)"/> <input type='image' src='images/securitypics/11.jpg' name='imageid' id='11' onClick="SendTo(11)"/> <input type='image' src='images/securitypics/12.jpg' name='imageid' id='12' onClick="SendTo(12)"/> <input type='image' src='images/securitypics/13.jpg' name='imageid' id='13' onClick="SendTo(13)"/> <input type='image' src='images/securitypics/14.jpg' name='imageid' id='14' onClick="SendTo(14)"/> <input type='image' src='images/securitypics/15.jpg' name='imageid' id='15' onClick="SendTo(15)"/> <input type='image' src='images/securitypics/16.jpg' name='imageid' id='16' onClick="SendTo(16)"/> <input type='image' src='images/securitypics/17.jpg' name='imageid' id='17' onClick="SendTo(17)"/> <input type='image' src='images/securitypics/18.jpg' name='imageid' id='18' onClick="SendTo(18)"/> <input type='image' src='images/securitypics/19.jpg' name='imageid' id='19' onClick="SendTo(19)"/> <input type='image' src='images/securitypics/20.jpg' name='imageid' id='20' onClick="SendTo(20)"/> <input type='image' src='images/securitypics/21.jpg' name='imageid' id='21' onClick="SendTo(21)"/> <input type='image' src='images/securitypics/22.jpg' name='imageid' id='22' onClick="SendTo(22)"/> <input type='image' src='images/securitypics/23.jpg' name='imageid' id='23' onClick="SendTo(23)"/> <input type='image' src='images/securitypics/24.jpg' name='imageid' id='24' onClick="SendTo(24)"/> <input type='image' src='images/securitypics/25.jpg' name='imageid' id='25' onClick="SendTo(25)"/> <!--end submit login images--> </form> </p> </div> <div class="clear"></div> </div> </body> </html>

some code giving help here with defiantly be appreciated. thanks! :p

    This should be a simple fix. When you set the value of 'imageid', you should be using 'image_id' since that's the JS variable you've defined.

    function SendTo(id){
            //shortening form elements
            var myForm      = document.getElementById('myForm');
            var image_id = document.getElementById('imageid');
    
        image_id.value = id;
    
        myForm.submit();            
    
    } 
    

    Hope this works...

      Write a Reply...