hi
im trying to code my web app so that for this particular section when a user clicks on an image the image is 'highlighted'.
On searching the forums i found a similar question and the sol'n given suggeted a function which changes the border thickness of the image on clicking it....
i also wanted to have a variable which keeps record of what image the user has clicked and i have implemented this part ok... its just when i have added some code to thicken the image border on clicking it nothing seems to happen ...?
is it because i have two functions defined for onClick ? ive never used two before like this so i dont know if its possible..
any advice...?
thanks
my code is:
im trying to code my web app so that for this particular section when a user clicks on an image the image is 'highlighted'.
On searching the forums i found a similar question and the sol'n given suggeted a function which changes the border thickness of the image on clicking it....
i also wanted to have a variable which keeps record of what image the user has clicked and i have implemented this part ok... its just when i have added some code to thicken the image border on clicking it nothing seems to happen ...?
is it because i have two functions defined for onClick ? ive never used two before like this so i dont know if its possible..
any advice...?
thanks
my code is:
Code:
<HTML><HEAD><TITLE>Credential Recovery: Image Authentication</TITLE>
<script language='JavaScript'>
function submitform(imageid)
{
document.test.imageid.value = imageid
document.test.submit()
}
function addBorder(imageid) {
var numimages = 3;
for (x=0;x < numimages;x++) {
document.getElementById("imageid" + x).style.border = '0px';
}
document.getElementById(imageid).style.border = '2px solid #ff0010';
}
</script>
<style type='text/css'>
<!--
.cursor { cursor: hand}
-->
</style>
</HEAD>
<BODY><IMG SRC='[URL unfurl="true"]http://localhost:8080/myApp/title.gif'><IMG[/URL] SRC='[URL unfurl="true"]http://localhost:8080/myApp/headerStrip.gif'><BR>[/URL]
<font face='Haettenschweiler' size='+2'>Please Click on the image that you chose when you registered. <BR> Then click the submit button to complete your selection.</font><BR> <BR>
<form action='[URL unfurl="true"]http://localhost:8080/myApp/servlet/SoundSelect'[/URL] method='post' name='test'>
<input type='hidden' name='sessionID' value='132'>
<input type='hidden' name='qTest' value='false'>
<input type='hidden' name='uID' value='287'>
<input type='hidden' name='attempts' value='1'>
<input type='hidden' name='imageid' value=''>
<TABLE BORDER='3' CELLSPACING='1' CELLPADDING='1'>
<TR>
<TD ALIGN = 'center'><img src='C:\mysql\data\mydb\img5.jpg' style='border:0px' id='image5' class='cursor' alt='5' onclick='submitform(5);addBorder('image5');' width='100' height='100'></TD>
<TD ALIGN = 'center'><img src='C:\mysql\data\mydb\img10.jpg'style='border:0px' id='image10' class='cursor' alt='10' onclick='submitform(10); addBorder('image10');' width='100' height='100'></TD>
<TD ALIGN = 'center'><img src='C:\mysql\data\mydb\img13.jpg'style='border:0px' id='image013' class='cursor' alt='13' onclick='submitform(13); addBorder('image13');' width='100' height='100'></TD>
</TR>
</TABLE> <table width='32%' border='0'><tr><td> </td><td> <div align='center'> <input type='submit' name='submit' value='submit'></div> </td> <td> </td> </tr> </table></form>
<BR><BR><IMG SRC='[URL unfurl="true"]http://localhost:8080/myApp/crFooter2.gif'[/URL] width='800'></BODY>
<script language="JavaScript">
<!--
window.open = SymRealWinOpen;
//-->
</script>
</HTML>