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

Shorten script

Hi,

This is probably a very easy question...but I just don't know the answer...

I want to shorten this script:

document.formulier.form_o_stoel1.checked = false;
document.formulier.form_o_stoel2.checked = false;
document.formulier.form_o_stoel3.checked = false;
document.formulier.form_o_stoel4.checked = false;
document.formulier.form_o_stoel5.checked = false;
document.formulier.form_o_stoel6.checked = false;
document.formulier.form_o_stoel7.checked = false;
document.formulier.form_o_stoel8.checked = false;
document.formulier.form_o_stoel9.checked = false;
document.formulier.form_o_stoel10.checked = false;

I think it should be possible with something like

for (i=0; i<10; i++) {
document.formulier.form_o_stoel&[i].checked = false;
}

Please take a minute to help me with this...
Thanks!
Jul 20 '05 #1
2 1618
"Francois" <fr************@gidesign.nl> wrote in message
news:3f*********************@news.inter.NL.net...
Hi,

This is probably a very easy question...but I just don't know the answer...
I want to shorten this script:

document.formulier.form_o_stoel1.checked = false;
document.formulier.form_o_stoel2.checked = false;
document.formulier.form_o_stoel3.checked = false;
document.formulier.form_o_stoel4.checked = false;
document.formulier.form_o_stoel5.checked = false;
document.formulier.form_o_stoel6.checked = false;
document.formulier.form_o_stoel7.checked = false;
document.formulier.form_o_stoel8.checked = false;
document.formulier.form_o_stoel9.checked = false;
document.formulier.form_o_stoel10.checked = false;

I think it should be possible with something like

for (i=0; i<10; i++) {
document.formulier.form_o_stoel&[i].checked = false;
}


for (var i=1; i<=10; i++) {
document.forms["formulier"].elements["form_o_stoel"+i].checked = false;
}
Jul 20 '05 #2

"Francois" <fr************@gidesign.nl> schreef in bericht
news:3f*********************@news.inter.NL.net...
Hi,

This is probably a very easy question...but I just don't know the answer...
I want to shorten this script:

document.formulier.form_o_stoel1.checked = false;
document.formulier.form_o_stoel2.checked = false;
document.formulier.form_o_stoel3.checked = false;
document.formulier.form_o_stoel4.checked = false;
document.formulier.form_o_stoel5.checked = false;
document.formulier.form_o_stoel6.checked = false;
document.formulier.form_o_stoel7.checked = false;
document.formulier.form_o_stoel8.checked = false;
document.formulier.form_o_stoel9.checked = false;
document.formulier.form_o_stoel10.checked = false;

I think it should be possible with something like

for (i=0; i<10; i++) {
document.formulier.form_o_stoel&[i].checked = false;
}

Please take a minute to help me with this...
Thanks!


Hi,

for (i=1; i<11; i++) {
document.formulier.elements["form_o_stoel" + i].checked = false;
}

Fred
Jul 20 '05 #3

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

Similar topics

4
by: B.J. | last post by:
Hi, Is there any way how I can shorten following code ? try {...} catch(FormatException) {SAME CODE IN ALL CATCH BLOCKS} catch(OverflowException) {SAME CODE IN ALL CATCH BLOCKS} E.g. to...
27
by: Mike MacSween | last post by:
Some of my users are getting 'Disk or Network Errors'. I've raised it with the network admins, they're looking into it. In the meantime... My 'standard' error handlers logs errors to a table...
15
by: Benjamin Rutt | last post by:
Are there any C tools that can find redundant #includes in a project, so as to shorten compile time? Of course, eliminating single #includes by hand and determining if the recompile fails is one...
8
by: ben | last post by:
i have a bit of code, that works absolutely fine as is, but seems over complicated/long winded. is there anyway to shorten/simplify it? the code is below. description of it: it's like strcpy in...
24
by: John Smith | last post by:
I want to shorten a string by replacing the last character by '\0'. The following code displays the string. It works fine. It's in a loop and different strings are displayed without problems....
3
by: neoswf | last post by:
hi. i want to shorten getElementById() string at my files. ive writen this function: function gebi(el){ document.getElementById(el) } and when i try to call an ID, i try to call him like this:...
3
by: UKuser | last post by:
Hi, Is there a way to shorten this line if ((ereg(".jpg",$filename))||(ereg(".eps",$filename))||(ereg(".tif", $filename))||(ereg(".tiff",$filename))||(ereg(".jpeg",$filename))||...
5
by: Dean | last post by:
Hi, I have a table with non-unique identifiers. I need to take all the values with the same ID's and combine them into one field with a semicolon as a seperator. These values may exceed 255...
1
by: treeguy | last post by:
I am not a developer but my site has long URL strings that have problem getting crawled. I understand Google now will crawl past the + but does not like the long strings. I tried URL rewrite and it...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.