Issue with a slider (javascript /jsp)
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sam_LaBlanc
Posted On:   Monday, June 20, 2005 05:49 PM

Hi, This may be a simple problem, however, unfortunately I haven't been able to get this to work: I have a javascript in my jsp page that displays a slider. Now, what I want to do is as the slider moves, to update two text boxes with the values resulting from the slider movement. So, the Slider can move from 0 to 100. The way the form bean is defined in the struts-config: type="org.apache.struts.action.DynaActionForm"> The Bean is like : public class LoadBalanceConfig { private String location; private String role; private String loadPercentage; In the script below I have to basically set    More>>




Hi,

This may be a simple problem, however, unfortunately I haven't been able to get this to work:

I have a javascript in my jsp page that displays a slider. Now, what I want to do is as the slider moves, to update two text boxes with the values resulting from the slider movement. So, the Slider can move from 0 to 100.

The way the form bean is defined in the struts-config:


type="org.apache.struts.action.DynaActionForm">





The Bean is like :

public class LoadBalanceConfig {

private String location;
private String role;
private String loadPercentage;


In the script below I have to basically set the values:


function shiftTo(obj, x, y) {
if (x <=scalaleft) {x=scalaleft}
if (x>=scalaright) {x=scalaright}

var colo =Math.floor((255/scalawidth*(x-scalaleft)))
var location1 = getNumericValue(colo)

if (isNav) {
obj.moveTo(x,buttontop)
} else {
obj.pixelLeft = x
obj.pixelTop = buttontop
}
// This does not work - it is here just as an example
//document.form2.setLoadPercentage(100-location1);
//document.form2.setLoadPercentage(location1);
}

But obviously this does now work... I was wondering if there is a way for my form to show the resluting values of the slider?

Any help would be appreciated.

Thanks!
Sam

   <<Less
About | Sitemap | Contact