Advertisement

03.26.2008 at 06:58PM PDT, ID: 23272764
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

Javascript/AJAX/Prototype.js - javascript calculator is not working

Asked by jpschreibman in JavaScript, PHP Scripting Language, JScript

Tags: , ,

I am working on a form here:

http://ibot.tv/test/removals

If you continue to page 2, you will see a "show calculator" button. This is an AJAX function which loads a series of drop-downs.

This function is working in FF, but not IE6. I have no idea why. See code for specifics:

Function 1- javascript

This is supposed to update the "estimated volume", and store the value in a hidden field. This way, if a user changes the drop-down, the value is adjusted accordingly.

Function 2- PHP

This function generates the drop-down boxes.

Thanks in advance.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
The javascript function:
 
function addValue(x,name,old){
			var y = $('ibot_est_vol').value;
			var z = $(old).value;
			var total = eval(Number(x)+Number(y)-Number(z)); 
			$(old).value = x;			
			$('ibot_est_vol').value = total;
		}
 
The PHP function:
 
// generate drop down box
function drop_down($name, $val) {
	print "<select id=\"$name\" name=\"$name\">\r\n";
	// qty 0-99
	while($x < 100) {
		print "<option value =\"".$x*$val."\" onclick=\"javascript:addValue(".$x*$val.",".$name.",".$name."_old);\">".number_format($x)."</option>\r\n";
		$x++;
	}		
	print "</select>\r\n";
	print "<input type=\"hidden\" id=\"".$name."_old\" name=\"".$name."_old\">";
}
 
This PHP function is called like so:
 
<td><? drop_down("vol1", 65);?> Settee, Large</td>
 
vol1 is unique to each drop down
[+][-]03.26.2008 at 07:46PM PDT, ID: 21218139

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: JavaScript, PHP Scripting Language, JScript
Tags: Javascript (AJAX), prototype.js, http://ibot.tv/test/removals
Sign Up Now!
Solution Provided By: cwichoski
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628