/    Sign up×
Community /Pin to ProfileBookmark

dynamically load checkbox values

I am stuck and need help. (pretty new to HTML, but I’m learning) ?

I have a web page that is designed as an output form (HTML object is printed as a report) – locally on a user’s PC

It is a process where I acesss a data base and retrieve various fields, generating JPGs as well. This works perfectly today.

flow is as follows:

1)Appl reads database & retrieves needed data

Example field1 = GOLFER
field2 = Male

2)I post all the information locally on my PC to my web page
——————————————–

3) Users double click on the output.html object to see their
results-they can print it out like a word doc

Here is my need:

I merely want to make this more robust and automatically check a checkmark box (based on my fields I retrieved above)

example HTML:

<input type=”checkbox” name=”capped” checked=”checked” accesskey=”&capped” />

I know this (checked=”checked”) is how it looks when it is the check box is checked manually. How can I dynamically check the above checkmark box at load time (remember there is no user intervention) Do I use Javascript? Is there any other ways to dynamically load fields?

thanks!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JNov 15.2005 — Do you mean something like this


[code=php]<script type="text/javascript">
onload=function checkTheBox(){
document.forms["f1"]["capped"].checked=true
}
</script>

<form name="f1">
<input type="checkbox" name="capped" accesskey="&capped" />
</form>[/code]
×

Success!

Help @golferdad spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...