By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

Accepting Terms and Conditions (textarea/radio button)

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
Rob
Thanks for all of the replies and info.

Regards

Rob

Nov 10 '06 #6

P: n/a

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 discussion thread is closed

Replies have been disabled for this discussion.