Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Compound statement at: <body onload> & <a href="#" onClick=....>


Message #1 by "kriz buenaventura" <vickriz@i...> on Wed, 6 Nov 2002 06:37:07
Hi there and good day to all,

just want to ask for help how can i correct my code:

a.  <body onload="javascript:setUp()","document.myform.politicalID.focus
()">

b.  SCRIPT:
      function Check(x,y) {
        for(i=1;i<=4;i++) {
           z = "option" + i ;
           document.all[z].src = "script/off.gif" ;
        }
        document.all[x].src = "script/on1.gif"
        document.all.agreebox.value = x
      }

    HTML:
   <form name="demoform">
	<table>
	  <tr>
  	   <td height="56" valign="top" align="center"><font 
size="2">Demo: CheckBox Image</font><br>
		<input type="text" name="agreebox" value="option1"></td>
	  </tr>  
	  <tr>
	    <td><font face="Tahoma" size="1"><a href="#" onClick="changeBox
('document.demoform.agreebox');return false">
		<img border="0" src="script/on1.gif" width="11" 
height="11" name=option1 onclick=Check(this.name,"")>Option 1</a></font>
	    </td>
          </tr>
       </table>
    </form>

all i want to do is when i press the text beside my image radio button it 
will turn ON and the input text value change also.
 
..i think the error comes from within the onClick at <a></a> and <img> 
tag's attribute but i dont know how to fix it...

pls help me
may thanks in advance..

  Return to Index