Jump to content

help!


Guest pipikins

Recommended Posts

Guest pipikins

hi there, i am a uni student, can someone tell where i am goin wrong with the following code, when looked at in IE, only the "Age" part looks right and the rest well doesnt. i would b greatfull of any help given here. is it cus i put in a table?????

<html><body><script type="text/javascript">function setStyle(x){document.getElementById(x).style.background="yellow"}function setNoStyle(x){document.getElementById(x).style.background="pink"}</script><h2><table border="0" width="57%" id="table1" cellspacing="0" cellpadding="0">	<tr>  <td align="right" width="47%" height="15%" style="float: right"><h2>Title:</h2></td>  <td width="46%" colspan="3" height="15%"style="float: right"> <SELECT name=title1> <OPTION value=Mr selected>Mr<OPTION  value=Mrs>Mrs<OPTION  value=Miss>Miss<OPTION  value=Dr>Dr<OPTION  value=Others>Others<OPTION</OPTION> </SELECT></td>	</tr>	<tr>  <td align="right" width="47%" height="15%" style="float: right"><h2>First name:</h2></td>  <td colspan="3" width="46%" height="15%" style="float: right">   <input type="text" onfocus="setStyle(this.id)" id="fname" onblur="setNoStyle(this.id)" name="T1" size="20" ></td>	</tr>	<tr>  <td align="right" width="47%" height="15%" style="float: right"><h2>Last name:</h2></td>  <td colspan="3" width="46%" height="15%" style="float: right">   <input type="text" onfocus="setStyle(this.id)" id="fname" onblur="setNoStyle(this.id)" name="T3" size="20" ></td>	</tr>	<tr>  <td align="right" width="47%" height="15%" style="float: right"><h2>House Number/Name: </h2></td>  <td colspan="3" width="46%" height="15%" style="float: right">   <input type="text" onfocus="setStyle(this.id)" id="lname" onblur="setNoStyle(this.id)" name="T4" size="20" ></td>	</tr>	<tr>  <td align="right" width="47%" height="15%" style="float: right"><h2>Post Code:</h2></td>  <td colspan="3" width="46%" height="15%" style="float: right">   <input type="text" onfocus="setStyle(this.id)" id="hname" onblur="setNoStyle(this.id)" name="T5" size="20" ></td>	</tr>	<tr>  <td align="right" width="47%" height="5%" style="float: right">  <h2>E-mail:</h2></td>  <td width="26%" height="5%" style="float: right">   <input type="text" onfocus="setStyle(this.id)" id="ename" onblur="setNoStyle(this.id)" name="T2" size="20" ></td>  <td width="5%" height="5%">  <p align="center"><h2>@</h2></td>  <td width="30%" height="5%"><SELECT name=title> <OPTION value=hotamil.com selected>hotmail.com<OPTION  value=yahoo.co.uk>yahoo.co.uk<OPTION  value=gmail.co.uk>gmial.co.uk<OPTION  value=hotmail.co.uk>hotmail.co.uk<OPTION  value=Others>Others<OPTION</OPTION> </SELECT></td>	</tr>	<tr>  <td align="right" width="47%" height="15%" style="float: right"><h2>Age:</h2></td>  <td width="46%" colspan="3" height="15%" style="float: right">  <form><script type="text/javascript">var today=new Date();var c=today.getYear();document.writeln("<select name=year_birth>");for(i=c- 16;i>=c- 106;i--)document.writeln("<option value="+i+">"+i)</script></select></form></td>	</tr>	</table></h2><br /><br /><input type="submit" value="Submit"><input type="reset" value="Clear"></form></body></html>

Edited by Jonas
Link to comment
Share on other sites

It looked fine to me, everything is in a 2 column layout.You do need to close your options thoough </option>and i would put the javascript function in the <head> of the page.How are you seeing the page? What do you want it to look like?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...