/    Sign up×
Community /Pin to ProfileBookmark

Checkboxes and function validation

I have a shopping cart script which calls a function function called dropdownvalidator when a user clicks on the ADD TO CART button. The dropdownvalidator javascript basically makes certain that user has chosen a color and size from the drop down selections. I recently have added a checkbox to the form on the page as follows:

<input type=”Checkbox” name=”Addon” value=”Yes”>

What I want to occur is if the user clicks on this box, I want the dropdownvalidator script to perform the following instruction:

Price = Price + Custom

Price and Custom are two defined fields which are available in my ASP script for referencing the actual price of the item and the “add-on” cost. This “add on” cost field is an additional cost if a user wants an additional service performed on a selected item they are purchasing.

I cannot figure out how to update the ASP “Price” field from within the dropdownvalidator function if the checkbox is selected. Any help or guidance is sincerely appreciated.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @rmfranks 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 5.24,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...