/    Sign up×
Community /Pin to ProfileBookmark

New guy needs to call Javascript function

Hello,
I am new to JavaScript and I am trying something I think should be simple.
I am using VS 2005. I have 2 check boxes one is a VB checkbox and the other is an html checkbox. I get if it is checked or not from a data grid. I can set the VB checkbox to checked or unchecked but not the HTML checkbox. I can’t figure out how to set the HTML checkbox. Here is what I have tried and I am sure I am not even close:

Works for VB checkbox:
chkbUseCompanyAddress.Checked = cgfDataGridGetBoolean(dgrdResults.SelectedItem.Cells(c_IsDefaultAccess).Text)

I use the below to send the VB’s checkbox status to javascript to then set the javascript checkbox. ( they never get into them as I am sure you know)

Does not work:
chkbUseCompanyAddress.Attributes(“onchange”) = “javascript: ChangeDefaultAddressCheckbox(‘” + chkbUseCompanyAddress.ClientID + “‘);”

Another attempt that does not work:
chkbUseCompanyAddress.Attributes(“onFocusOut”) = “javascript: ChangeDefaultAddressCheckbox(‘” + chkbUseCompanyAddress.ClientID + “‘);”

All I need is to set the HTML checkbox to equal the same as the standard control. I have a JavaScript function that will work I just don’t know how to call it since the above does not work. I am sure there must be an easier way.

Thanks hope it kind of makes sence

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @smithsf22 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,
)...