472,353 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Accepting Terms and Conditions (textarea/radio button)

Rob
Hi all,

I would like to have a textarea control on my web page that is complete
with terms and conditions, in addition, I would like a radio button
beneath this to indicate the acceptance of these terms and conditions.

The part which I am struggling to find information online about is how
to only activate the radio button (ie, prior to this event its
disabled) when the user has scrolled to the bottom of the textarea.

I've seen this done a lot when I'm installing programs via Windows, and
I'm sure someone must have come up with a way to do this via the web
also?

It obviously cannot involve in anyway the user actually clicking "in"
the textarea to get the position of the cursor, it would have to be
based on a "scroll to the bottom" as such...

Any information would be appreciated.

Best regards

Rob

Nov 8 '06 #1
6 5623
Rob said the following on 11/8/2006 12:02 PM:
Hi all,

I would like to have a textarea control on my web page that is complete
with terms and conditions, in addition, I would like a radio button
beneath this to indicate the acceptance of these terms and conditions.

The part which I am struggling to find information online about is how
to only activate the radio button (ie, prior to this event its
disabled) when the user has scrolled to the bottom of the textarea.

I've seen this done a lot when I'm installing programs via Windows, and
I'm sure someone must have come up with a way to do this via the web
also?

It obviously cannot involve in anyway the user actually clicking "in"
the textarea to get the position of the cursor, it would have to be
based on a "scroll to the bottom" as such...

Any information would be appreciated.
Instead of a textarea, use an IFrame and put the checkbox at the bottom
of the IFrame page. They can't click it without at least scrolling to
the bottom of it to even find the checkbox.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 8 '06 #2
Rob
Randy Webb wrote:
Instead of a textarea, use an IFrame and put the checkbox at the bottom
of the IFrame page. They can't click it without at least scrolling to
the bottom of it to even find the checkbox.
Hi Randy,

Thank you for your reply.

I hadn't thought of that approach, not entirely sure how'd I'd pick up
on the event of the button being ticked in my .net page - but that
aside, does this mean that the way I descibed is not possible?

Regards

Rob

Nov 9 '06 #3
VK

Rob wrote:
Randy Webb wrote:
Instead of a textarea, use an IFrame and put the checkbox at the bottom
of the IFrame page. They can't click it without at least scrolling to
the bottom of it to even find the checkbox.

Hi Randy,

Thank you for your reply.

I hadn't thought of that approach, not entirely sure how'd I'd pick up
on the event of the button being ticked in my .net page - but that
aside, does this mean that the way I descibed is not possible?
textarea element on IE has onscroll event handler so that would be
easy: but this handler is not implemented on other UA's.

So you may shoose a styled (overflow:scroll) block container (div or
pre), listen events for it, study scrollTop property and handle
buttonObject.disabled = 'false' for buttons located below that
container.

Nov 9 '06 #4
Rob said the following on 11/9/2006 6:53 AM:
Randy Webb wrote:
>Instead of a textarea, use an IFrame and put the checkbox at the bottom
of the IFrame page. They can't click it without at least scrolling to
the bottom of it to even find the checkbox.

Hi Randy,

Thank you for your reply.

I hadn't thought of that approach, not entirely sure how'd I'd pick up
on the event of the button being ticked in my .net page
onclick of the checkbox/radio button, you set a form field in the parent
page and check that field in your .net page.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 10 '06 #5
Rob
Thanks for all of the replies and info.

Regards

Rob

Nov 10 '06 #6

Rob wrote:
Thanks for all of the replies and info.
If this thanks do not mean that you solve problem:)
Check whether container is scrolled to the bottom and then allow to
check radio button "I agree", otherwise - show warning.

<html>
<head>
<script type=text/javascript>
function check(sender)
{
var terms = document.getElementById("terms");
if (terms.scrollHeight-terms.scrollTop terms.clientHeight)
{
sender.checked = false;
alert("Read terms");
}
}
</script>
</head>
<body>
<div id="terms"
style="width:300px;height:100px;overflow:auto;bord er:solid 1px black">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Sed volutpat tellus sed neque. Mauris libero quam, interdum
pellentesque, malesuada in, viverra vitae, nisi.
Integer posuere commodo orci. Etiam scelerisque lectus eu tellus.
Integer bibendum sem sed metus.
In enim mauris, vehicula vel, adipiscing a, consectetuer sit amet,
nunc. Curabitur eget elit.
</div>
<br>
<input type="radio" onclick="check(this)" name="agree">I argree
</body>
</html>

Nov 10 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Doug van Vianen | last post by:
Hi, I am working on an Applet which provides some mouse practice for new computer users in our local seniors' computer club. The applet contains...
2
by: Ritesh Shah | last post by:
Is there anyway in JavaScript to hide/show a textarea based on what radio button is selected? I am totally new to JavaScript and have no idea about...
4
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1...
2
by: danielboendergaard | last post by:
Hey Im making a homepage in php. I use a html form to put data into mysql and i want to make some buttons which inserts user input values into a...
10
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at...
1
by: snipersix | last post by:
How do you display values in a textarea using javascript. ex. i have 2 radio buttons o Adult =$9.99 o Child =$6.99 i...
3
by: Syswatch | last post by:
Hi out there... I am pretty new to javascript, and is looking for some help here. I have a problem, I need a small javascript, which checks if...
3
by: santhosh89 | last post by:
hi guys, see i want to develop a script and developed one but it s not working. the concept is there will be three radio buttons. the user has to...
1
by: jmkc888 | last post by:
Hi All, I have developed a small application and wish to make it available as free download on the internet. 1. On the Home page, when the...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.