ImperialSpider
01-29-2005, 09:45 AM
PART I. How do you specify the background color of a text area? and also would like to know if there is a way to write protect the info in the text area, so a user does not change what is written in the text area, then print out so something completely different comes out. <would be for a legal agreement form>. Can someone help me with this???
PART II. I am interested in a script that would allow me to specify what options come out on a javascript alert box. I want to have options like 'yes' and 'no' instead of 'OK' and 'Cancel'., and then have those options take the user to different pages within the site, depending on which option they click. Is this possible?
I am very new to javascripts, so please answer in lamens terms. below is the code I am working with. Any help would be greatly appreciated...Thanks in Advance...ImperialSpider
<html>
<head>
<title>agreement form</title>
<script type="text/javascript">
function agreesubmit(el){
var tempobj;
var els=el.form.elements;
for (var i=0;i<els.length;i++){ //hunt down submit button
tempobj=els[i];
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!el.checked;
}
}
function defaultagree(el){
if (el.agreecheck.checked){
alert("Great, Lets get started.");
location.href='page1.html';
}
else
alert("Please check the box if your agree to the conditions")
return false
}
</script>
</head>
<body>
<form name="agreeform" onSubmit="return defaultagree(this)">
<p>YOU MUST MEET MY CONDITIONS, WHICH ARE...</p>
<textarea rows="5" name="S1" cols="30" style="width:60%" wrap="virtual">
1. FIRST CONDITION.
2. SECOND CONDITION.
3. THIRD CONDITION.
4. FOURTH CONDITION.
5. FIFTH CONDITION.
6. SIXTH CONDITION.
7. SEVENTH CONDITION.
</textarea>
<p>
<input name="agreecheck" type="checkbox" onClick="agreesubmit(this)" />
<b>Check box if you agree to the above conditions</b>
<p><input type="Submit" value="Submit!" disabled="disabled" /></p>
</form>
</body>
</html>
PART II. I am interested in a script that would allow me to specify what options come out on a javascript alert box. I want to have options like 'yes' and 'no' instead of 'OK' and 'Cancel'., and then have those options take the user to different pages within the site, depending on which option they click. Is this possible?
I am very new to javascripts, so please answer in lamens terms. below is the code I am working with. Any help would be greatly appreciated...Thanks in Advance...ImperialSpider
<html>
<head>
<title>agreement form</title>
<script type="text/javascript">
function agreesubmit(el){
var tempobj;
var els=el.form.elements;
for (var i=0;i<els.length;i++){ //hunt down submit button
tempobj=els[i];
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!el.checked;
}
}
function defaultagree(el){
if (el.agreecheck.checked){
alert("Great, Lets get started.");
location.href='page1.html';
}
else
alert("Please check the box if your agree to the conditions")
return false
}
</script>
</head>
<body>
<form name="agreeform" onSubmit="return defaultagree(this)">
<p>YOU MUST MEET MY CONDITIONS, WHICH ARE...</p>
<textarea rows="5" name="S1" cols="30" style="width:60%" wrap="virtual">
1. FIRST CONDITION.
2. SECOND CONDITION.
3. THIRD CONDITION.
4. FOURTH CONDITION.
5. FIFTH CONDITION.
6. SIXTH CONDITION.
7. SEVENTH CONDITION.
</textarea>
<p>
<input name="agreecheck" type="checkbox" onClick="agreesubmit(this)" />
<b>Check box if you agree to the above conditions</b>
<p><input type="Submit" value="Submit!" disabled="disabled" /></p>
</form>
</body>
</html>