Javascript Problem

Post any questions you may have here

Javascript Problem

Postby ahwoogamac on Fri Jul 18, 2008 2:30 am

While searching for a solution, I've found a few other people working on calculators on this forum. I created one myself by pulling from two scripts that I found. One script allows for the form to calculate the total cost by using field names and the onchange event. The other script adjusts the value of checkboxes (as well as calculating the total cost via the field names), using the onclick event, so that the total will reflect the click action.

If I leave the javascript in the fields, the calculation works, but the generated e-mail only shows the field titles - not the values. If I remove the script, the opposite happens.

I have attached a backup of the form. Also, a direct link to the form is at:

http://www.planetbobstudios.com/web-est ... lator.html

I'm not sure why the values of the fields aren't being included in the e-mail. [file name=web_price.cfbak size=24613]http://www.chronoengine.com/images/fbfiles/files/web_price.cfbak[/file]
ahwoogamac
Fresh Boarder
 
Posts: 3
Joined: Mon Jul 07, 2008 4:22 pm

Re:Javascript Problem

Postby ahwoogamac on Fri Jul 18, 2008 3:27 pm

Oh, I forgot to mention that I hid the "submit" button on my site. I did this so that people wouldn't try to send in the form, but they could still use the calculator.
ahwoogamac
Fresh Boarder
 
Posts: 3
Joined: Mon Jul 07, 2008 4:22 pm

Re:Javascript Problem

Postby GreyHead on Sat Jul 19, 2008 12:39 pm

Hi ahwoogamac,

I'm not completely sure what's happening but there seems to be a problem with the '.' in the field names. The field name 'PROD_Purchase_Secondary_10.00' shows up in the results array as 'PROD_Purchase_Secondary_10_00' - the '.' has switched to an '_'.

I don't know where or why this is happening but it would explain the problem I think.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3247
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Javascript Problem

Postby ahwoogamac on Sat Jul 19, 2008 8:29 pm

I should have seen that staring at me right in the face! The demo of the script all used decimals, so I didn't think anything about using them. All my prices are whole number, so I just removed the "." and it worked fine. Thanks for helping me see the obvious. ;)

A quick side question. As you can see, I'm using a php script that recognizes if a person is logged in. If their not, I'm inserting CB registration fields. Will there be a validation issue if I make those fields required? They won't be listed in the form when somebody is logged in. If so, is there way to work around that?
ahwoogamac
Fresh Boarder
 
Posts: 3
Joined: Mon Jul 07, 2008 4:22 pm

Re:Javascript Problem

Postby admin on Sun Jul 20, 2008 5:57 pm

If I understand it correct then they will not be validated if they don't exist!

Cheers

Max
ChronoForms Developer Thanks for using ChronoForms.
If you have any problems with ChronoForms please tell us.
If you like ChronoForms please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
User avatar
admin
Platinum Boarder
 
Posts: 2107
Joined: Mon Aug 14, 2006 5:29 am


Return to Questions & Answers

Who is online

Users browsing this forum: GreyHead, Yahoo [Bot] and 6 guests