You are viewing limited content. For full access, please sign in.

Question

Question

Can a checkbox hold a dollar amount value for calculations?

asked on February 13, 2014

Trying to create print shop work order but we have checkboxes for different types of paper and each type of paper has a different price.  Once these boxes are selected, depending on how many copies needed for the job, i need to total what was checked off with how many copies needed.

 

0 0

Answer

APPROVED ANSWER
replied on February 13, 2014

Armando, you can assign a numerical value to each checkbox. Then using JavaScript you can perform calculations to add up the total amount along with the total of copies needed. We are doing something similar with School Transcript Requests. Depending on how many copies of their transcripts they are wanting along with if they want rush or standard priority. As Devin mentioned though, depending on how many options you have for them to choose from it may be easier to have a database hold those values. Especially if you have other forms that would use the same information.

1 0
replied on February 13, 2014

where did you assign the value for the checkboxes? 

0 0
replied on February 13, 2014

When you add the checkbox to the form and click on "Edit" there is a Values area for the options added to the form.

 

1 0
replied on February 13, 2014

thank you.  i kind of figured it was there but wasnt sure if it was possible with a number as a value.

0 0

Replies

replied on February 13, 2014

Are you wanting to do the calculation live as the user checks the boxes, or do you want to do it after the form is submitted?

 

I wouldn't recommend attributing the checkboxes with prices directly. Instead you could do the lookup using a database. That would allow easier changing of the prices without digging around in the code. If you were doing it live, you'd have to pull in some JavaScript and AJAX in order to look up prices.

 

If you were doing it after the form is submitted, you could look at what options are selected and do lookups and calculations on the back-end.

1 0
replied on February 13, 2014

The Populating a field with radio button or checkbox values section on this page in the online help has an example that might be useful for you if you're trying to perform calculations with these values.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.