Forum Moderators: open

Message Too Old, No Replies

html & javascript

html & javascript

         

anirdesh

12:30 am on Nov 12, 2004 (gmt 0)

10+ Year Member



I would like to pass selected years from year.html to cnty2005.html. On cnty2005.html, I would like to list the selected years.
I need to correct javascript & form parameters.

I hope sime body can assist me!

<!--note year.html # 1 -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Sample</title>
<script type="text/javascript">
<!--
function execute(form) {
var count=0;
for(var i=0;i<form.selectList1.length;i++) {
if (form.selectList1.options[i].selected) {
count++;
}
}
}
// -->
</script>
<form ACTION="/il/scripts/odbic.exe/il/cnty2005.htmL" >
<p>
<select name="selectList1" size="5" multiple onClick="execute(this.form)">

<option value=0>1999</option>
<option value=1>2000</option>
<option value=2>2001</option>
<option value=3>2002</option>
<option value=4>2003</option>
<option value=5>2004</option>
</select>
</p>

<input type="hidden" name="btn1" >
<input type="submit" name="btn1" value="submit">
</p>
</form>

</body>
</html>

!
CNTY2005.html # 2
!
<HTML>

<HEAD>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

<META NAME="GENERATOR" CONTENT="Mozilla/4.06 [en] (Win95; U) [Netscape]">
<TITLE> Limits System</TITLE>

</head>
$btn1$

<BODY BGCOLOR="#FFFFFFF" TEXT="#000000" LINK="#CC6600" ALINK="#CC6600" VLINK="#CC6600" topMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">

<!--DATABASE DSN= lmts-->

<BR>

<!--NOTE $countyname$ -->

<FONT FACE="Arial, Verdana, Comic Sans MS, Sans-serif" SIZE="1" align="right" COLOR="teal"> <B>$time$, $today$ </B> </FONT>

<P><CENTER>


<FONT FACE="Arial, Verdana, Comic Sans MS, Sans-serif" SIZE="5" COLOR="#123422">
<B>Limits</B>
</BR>
</FONT>

</FONT>
</CENTER>
</P>

<!--SQL SELECT * FROM FINAL WHERE ((STATENAME='$statename$') and
(COUNTY_NAME ='$countyname$')) -->

<FORM METHOD="post">

<CENTER>

<TABLE BORDER=4 BORDERCOLOR="#000066" WIDTH="80%" BGCOLOR="#F0DA95" FGCOLOR="#D8A327" FONT SIZE="-1">

selected years :
<B><TR><TR>

<TH bgcolor=""#F0DA95" COLSPAN="1"></TH>
<TH bgcolor="SILVER" COLSPAN="1">5% INCOME LIMITS</TH>
<TH bgcolor="SILVER" COLSPAN="1">10% INCOME LIMITS</TH>
</TR>
<TR> <TH bgcolor=""#F0DA95" COLSPAN="1"></TH>
<TH bgcolor="SILVER" COLSPAN="1">5-PERSONS LIMITS</TH>
<TH bgcolor="SILVER" COLSPAN="1">10-PERSONS LIMITS</TH>


</TABLE>

</forM>

</body>
</html>

RonPK

8:44 am on Nov 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The proper way to pass data from one page to another page is by means of a server-side script. You'd better not rely on JavaScript for such things, as not every browser has it enabled.

kaled

7:23 pm on Nov 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



RonPK is correct. However, there is nothing to stop you passing parameters to html files and reading them with javascript.

e.g.

www.yourdomain.com/page.html?param1=value1&param2=value2

I pass data around like this, for instance, when I direct a user to a form-mail page, I set the product value automatically. If javascript is disabled, it simply means that the user has to set this value manually.

Kaled.