Hi,
I've got a Slider that is used to select a loan amount between 10000 and 100000 (code below). I wanted to display the value selected on the slider in GBP in the format: £10,000 etc. I used the following post to add Javascript code (script below) to achieve this and this works fine:
http://forums.asp.net/p/1175047/1976782.aspx#1976782
However, further down my form there is a dropdownlist that performs a postback when the selected value is changed. This postback causes the formatted currency value from my slider (displayed in 'display') to be reset. Any ideas on how I can get round this?
The javascript I added:
function pageLoad() {
$find('formatcurrency').add_valueChanged(onSliderValueChanged);
}
function onSliderValueChanged(){
var value = $find('formatcurrency').get_Value();
// Code to manipulate value to new value in correct format - 'newvalue'
document.getElementById('display').innerHTML = newvalue
}
My code:
<asp:TextBox ID="loanamount" CssClass="slidertextbox" runat="server"></asp:TextBox>
<cc1:SliderExtender runat="server" ID="SliderExtender1"
TargetControlID="loanamount" Decimals="0" Length="200" BehaviorID="formatcurrency" Minimum="10000" Steps="19" Maximum="100000"
EnableHandleAnimation="true" />
<b id="display" style="width: 60;" class="sliderloan"></b>
Many Thanks
StuartH