Jump to content

has anyone seen something like this before $('#pwrcm:checkbox:checked')


yanith

Recommended Posts

hello guys,

this is my first post and I had been looking for some help with a php/javascript form that i was passed down.

 

the form is a 93 files mess, however i got to understand the functions and how variables pass from file to file.  so i was able to make most of the changes except one

 

 

In the calculator.js

I have a function that creates the subtotals and displays them on the screen.

 

I can't show the entire function cuz is over 600 lines but i'll explain my situation below

 

I have a drop-down selection box that need to be add-up in the example code below.

 

for radio buttons classes are used to group the price, you can see it in $('.hsis:radio:checked')

 

for check boxes ids are used to display the price $('#pwrcm:checkbox:checked')

 

however in a code with similar syntax i need to show the price of each drop down selections. how could it be done?

 

I  tried $('#hdtv:select:selected') and updated the variable names but no luck  :confused:

 

 

function addup_subtotals() {

    var hsi_subtotal = $('.hsis:radio:checked').val();

            if(isNaN(hsi_subtotal)) {hsi_subtotal=0;} else {hsi_subtotal=parseFloat(hsi_subtotal);}

            var pwrcm_subtotal = $('#pwrcm:checkbox:checked').val();

            if(isNaN(pwrcm_subtotal)) {pwrcm_subtotal=0;} else {pwrcm_subtotal=parseFloat(pwrcm_subtotal);}

 

has anyone seen something like this before

Link to comment
Share on other sites

Thanks requinix!

 

while id didn't exactly work you point me in the right direction, the link really help me understand more about it. I really appreciate it.

 

I end up creating two extra variables to multiple the unit cost times times the amount of units requested. and passing those to a regular variable.

 

I end up using this:

 

var stb_db_total = $('#stb_db_total').val();
	if (isNaN(stb_db_total)) {stb_db_total=0;} else {stb_db_total=parseFloat(stb_db_total);}

 

Thanks a lot

 

this puppy is solved :D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.