All,
I have a piece of code which enables some scrolling text along the screen. This code was 'borrowed' from another source. However my JavaScript knowledge is limited and i cannot get this code to do what i require. This is where someone steps in with some help....The code is.....
<form id="hiddenOracleForm">
<input type="hidden" name="recordset1" value="banana, grape, orange">
<input type="hidden" name="recordset2" value="<oracle>select fruit from basket</oracle>">
</form>
<!-- START OF SCRIPT -->
<HTML>
<HEAD>
<TITLE>4 Line Scroller</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF" TEXT="000000" LINK="0000FF" VLINK="800080" ALINK="FF0000">
<head>
<script language="JavaScript">
<!-- begin
var max=0;
function textlist()
{
max=textlist.arguments.length;
for (i=0; i<max; i++)
this=textlist.arguments;
document.write('the variable for rs1 is ' + rs1);
}
var rs1 = document.forms['hiddenOracleForm'].recordset1.value;
tl=new textlist
(
rs1
);
var x=0; pos=0;
var l=tl[0].length;
function textticker()
{
document.tickform.tickfield.value=tl[x].substring(0,pos)+"_";
if(pos++==l) { pos=0; setTimeout("textticker()",1000); x++;
if(x==max) x=0; l=tl[x].length; } else
setTimeout("textticker()",50);
}
// end -->
</script>
<head>
<body onLoad="textticker()" >
<center>
<form name="tickform"><input type=text name="tickfield" size=40></form>
</BODY>
</HTML>
We can see from the above code that the variable RS1 gets set in the javascript like so....var rs1 = document.forms['hiddenOracleForm'].recordset1.value;
And the form elements are set in the HTML.
My problem is, if i included recordset2.value, just the same a rs1, the code errors. Is there something i am not understanding about how javascript works. Can i not set more than one varible within JavaScript?
Another problem i am unable to sort out.....it is highly likely that i won't know how many variables i am going to be setting to text in the JavaScript, this can be a random number of variables, ranging from rs1 to rs10, for example..
Also, if i try to add rs2 with rs1 in the textlist, i also get an error.
Any help would be greatly appreciated.
Nunners
I have a piece of code which enables some scrolling text along the screen. This code was 'borrowed' from another source. However my JavaScript knowledge is limited and i cannot get this code to do what i require. This is where someone steps in with some help....The code is.....
<form id="hiddenOracleForm">
<input type="hidden" name="recordset1" value="banana, grape, orange">
<input type="hidden" name="recordset2" value="<oracle>select fruit from basket</oracle>">
</form>
<!-- START OF SCRIPT -->
<HTML>
<HEAD>
<TITLE>4 Line Scroller</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF" TEXT="000000" LINK="0000FF" VLINK="800080" ALINK="FF0000">
<head>
<script language="JavaScript">
<!-- begin
var max=0;
function textlist()
{
max=textlist.arguments.length;
for (i=0; i<max; i++)
this=textlist.arguments;
document.write('the variable for rs1 is ' + rs1);
}
var rs1 = document.forms['hiddenOracleForm'].recordset1.value;
tl=new textlist
(
rs1
);
var x=0; pos=0;
var l=tl[0].length;
function textticker()
{
document.tickform.tickfield.value=tl[x].substring(0,pos)+"_";
if(pos++==l) { pos=0; setTimeout("textticker()",1000); x++;
if(x==max) x=0; l=tl[x].length; } else
setTimeout("textticker()",50);
}
// end -->
</script>
<head>
<body onLoad="textticker()" >
<center>
<form name="tickform"><input type=text name="tickfield" size=40></form>
</BODY>
</HTML>
We can see from the above code that the variable RS1 gets set in the javascript like so....var rs1 = document.forms['hiddenOracleForm'].recordset1.value;
And the form elements are set in the HTML.
My problem is, if i included recordset2.value, just the same a rs1, the code errors. Is there something i am not understanding about how javascript works. Can i not set more than one varible within JavaScript?
Another problem i am unable to sort out.....it is highly likely that i won't know how many variables i am going to be setting to text in the JavaScript, this can be a random number of variables, ranging from rs1 to rs10, for example..
Also, if i try to add rs2 with rs1 in the textlist, i also get an error.
Any help would be greatly appreciated.
Nunners