Javascript Slider to Update TextBox

Hello,

I've created a calculator in excel and then used another product to convert the excel into javascript html. The problem is that I've altered the html to include sliders however when i use the slider it doesn't auto update the textbox unless a radio button is clicked.  Just wondering if there is a an attribute(s) that need to be altered.

Not sure if its against rules to provide a link to the calculator but here it is..

http://www.cronicco.com

Many thanks.
gindoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

scooby_56Commented:
hi,

On-click of the radio buttons calls recalc_onclick()

You could try adding a call to this from inside the f_sliderMouseUp() function in slider.js



function f_sliderMouseUp (e_event, b_watching) {
	if (window.n_activeSliderId != null) {
		var o_slider = window.A_SLIDERS[window.n_activeSliderId];
		o_slider.f_setValue(o_slider.n_minValue + (o_slider.b_vertical
			? (o_slider.n_pathLength - parseInt(o_slider.e_slider.style.top) + o_slider.n_pathTop)
			: (parseInt(o_slider.e_slider.style.left) - o_slider.n_pathLeft)) / o_slider.n_pix2value);
		if (b_watching)	return;
		window.n_activeSliderId = null;
	
        //New call here
        recalc_onclick();

}
	if (window.f_savedMouseUp)
		return window.f_savedMouseUp(e_event);

        
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leakim971PluritechnicianCommented:
Hello gindo,

Include this script in the head of your page for example :


<script language="javascript">
	window.onload = function() {
		document.getElementById("pA9E1").setAttribute("onmouseup", "before_recalc_onclick()");	
		document.getElementById("pA9E2").setAttribute("onmouseup", "before_recalc_onclick()");	
		document.getElementById("pA9E3").setAttribute("onmouseup", "before_recalc_onclick()");	
	}
	function before_recalc_onclick() {
		if(document.getElementById("pA9E1").checked) {
			recalc_onclick(document.getElementById("pA9E1"));
		}
		else if(document.getElementById("pA9E2").checked) {
			recalc_onclick(document.getElementById("pA9E2"));
		}
		else if(document.getElementById("pA9E3").checked) {
			recalc_onclick(document.getElementById("pA9E3"));
		}
	}
</script>

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.