
Nov 7th, 2005, 14:21
|
|
Banned Member
|
|
Join Date: Sep 2005
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Re: prompting
- PHP: Select all
<html> <head> <pre> <script language="JavaScript"> <!-- ***************** javaskript ************** var maxroe=8; var maxcol=10; //**** default input numroes=3; numcols=4 //* document.write('<div align="center">'); document.write('<table border="1" cellpadding="5">'); //******* get from yuzer...# roes string1=window.prompt("enter # roes, max=8", "5"); if(string1 ==""){string1="0"} numroes=parseInt(string1); if(numroes < 1){ stringx="**** error yer input # roes=0"; alert(stringx); numroes=3; } if(numroes > maxroe){ stringx="warning...max # roes="+maxroe+", will set #="+maxroe; alert(stringx); numroes=8} //******* get from yuzer...# columns string2=window.prompt("number columns, max=10", "3"); if(string2 ==""){string2="0"} numcols=parseInt(string2); if(numcols < 1){ stringx="**** error yer input # cols=0"; alert(stringx); numcols=4; } //* //********** loop1...over roes for(nowroe=1; nowroe<=numroes; nowroe=nowroe+1){ //* stringx="nowroe="+nowroe+", max="+numroes; //* alert(stringx); document.write('<tr align="center">'); //* //********** loop2...over columns for(nowcol=1; nowcol<=numcols; nowcol=nowcol+1){ document.write('<td bgcolor="#000000">'); werkstr="<font color='#ffff33'>"; werkstr=werkstr+" R"+nowroe+" C"+nowcol+"</font>"; document.write(werkstr); document.write("</td>"); } //****** bottom av inner loop document.write("</tr>") } //****** bottom av outer loop document.write('</table></div>'); // --> </script> </head> </html>
Last edited by Rob; Nov 7th, 2005 at 15:27.
|