473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 5696
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 several cards, in a card layout, which are...
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 any of it. Thanks.
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 value=3> <br> <input type="radio" name=p2 value=1>...
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 textarea. I have used a button like this: <input...
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 this snip of code. I am trying to set the radio...
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 need it to be, so that if i select adult in the...
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 there is any text in my textarea, and if it is NOT...
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 check one radio button and click the button next...
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 user clicks on "Download" button, the Terms Of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.