473,385 Members | 1,324 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,385 software developers and data experts.

Disable all form field except submit button

i got a form full of radio buttons appx. 60-70, depends on the page.
Some times 60, sometimes 55.... After certain period of time, i want to
disable or make readonly all the radio button inside the form except
submit button.

i have done the timing part, i hav setup a running clock which will
trigger the event @ XX amount of time but i m unable to make the radio
button disable or read only! remember submit button shld be available
to submit the form....

can ou please help???/
thnx

Jun 22 '06 #1
6 8563
mi******@gmail.com wrote:
i got a form full of radio buttons appx. 60-70, depends on the page.
Some times 60, sometimes 55.... After certain period of time, i want to
disable or make readonly all the radio button inside the form except
submit button.
thnx


You'll probably want to make them read-only, as making them disabled
will prevent their values from being submitted to the server.

function makeAllReadOnlyExceptSubmit()
{
var f = document.getElementById("idOfYourForm");
var inputs = f.getElementsByTagName("input");
for(var i = 0; i < inputs.length; i++)
if(inputs[i].type != "submit")
inputs[i].readOnly = true;
}
Jun 22 '06 #2
Jeremy wrote:
function makeAllReadOnlyExceptSubmit()
{
var f = document.getElementById("idOfYourForm");
var inputs = f.getElementsByTagName("input");
for(var i = 0; i < inputs.length; i++)
if(inputs[i].type != "submit")
inputs[i].readOnly = true;
}


Actually, you probably don't even need to check whether it's a submit
button or not - I don't think making a submit button read-only will
prevent it from being operational (techically it's ALWAYS read-only
since the user can't affect its value).

Jeremy
Jun 22 '06 #3
not working!!! radio buttons are still available to select and change
value
Jeremy wrote:
Jeremy wrote:
function makeAllReadOnlyExceptSubmit()
{
var f = document.getElementById("idOfYourForm");
var inputs = f.getElementsByTagName("input");
for(var i = 0; i < inputs.length; i++)
if(inputs[i].type != "submit")
inputs[i].readOnly = true;
}


Actually, you probably don't even need to check whether it's a submit
button or not - I don't think making a submit button read-only will
prevent it from being operational (techically it's ALWAYS read-only
since the user can't affect its value).

Jeremy


Jun 22 '06 #4
mi******@gmail.com wrote:
not working!!! radio buttons are still available to select and change
value


At the end of the day, it's up to your user-agent to decide whether the
read-only attribute will even be honored, and what effect it will have
if it is.

Do you have a URL or code snippet? It would be very helpful in
determining why your code isn't working.

Jeremy
Jun 22 '06 #5

mi******@gmail.com wrote:
i have done the timing part, i hav setup a running clock which will
trigger the event @ XX amount of time but i m unable to make the radio
button disable or read only! remember submit button shld be available
to submit the form....


How are you setting the clock?

You may want to put an alert where it sets them to readonly, to verify
that it is indeed getting there.

For the timer, you may want to look at setTimeout, which is a
javascript function.

Jun 22 '06 #6
Sorry application is in offline mode, form is generated by php...

i tried it on IE6 & 7, firefox, opera as well as on Safari its not
working...

i hav inserted an alert jst before and after your code... both the
alert event is triggered but readonly is not working...

Jeremy wrote:
mi******@gmail.com wrote:
not working!!! radio buttons are still available to select and change
value


At the end of the day, it's up to your user-agent to decide whether the
read-only attribute will even be honored, and what effect it will have
if it is.

Do you have a URL or code snippet? It would be very helpful in
determining why your code isn't working.

Jeremy


Jun 23 '06 #7

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

Similar topics

5
by: http://links.i6networks.com | last post by:
I want to force the users to click submit to submit the forms. How do I disable "Enter Key" which will submit the form automatically when they entered the data in text field then pressed "enter key"
2
by: techfuzz | last post by:
I scoured this group and others looking for the best way to disable a button after the first click to prevent multiple submissions, but never did find anything that worked like they said it would. ...
14
by: Sinity | last post by:
Anyone knows the method/codes to disable the clicked button after first click by using .aspx-- to prevent people to click many time when waiting for the server response. I tried to do this by...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
6
by: Al Cohen | last post by:
I'm using a LinkButton to call some code, then do a redirect. The code does some queries, sends some emails, and takes a few moments before the redirect is performed. I'd like to disable my...
3
by: Jeff | last post by:
I have a payment form with a submit button. A large percentage of users double-click the submit button thus submitting their payment information twice. I would like to use javascript to disable...
4
by: kschneider | last post by:
Assume there's a form with it's action attribute all set to post to a URL, but without a submit control. Form submission is done via a link and I want to prevent the classic "double submit"....
16
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.