Accepting Terms and Conditions (textarea/radio button)

R

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
 
R

Randy Webb

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.
 
R

Rob

Randy said:
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
 
V

VK

Rob said:
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.
 
R

Randy Webb

Rob said the following on 11/9/2006 6:53 AM:
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.
 
M

marss

Rob said:
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;border: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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top