c# - Jquery currency validation according to current thread culture -
i making control currency giving list of currency types in drop down , when user select currency in drop down. text box(of currency) validation should according currency , if type drop down not selected validation should according current culture.
my code doing server side is
protected override void onload(eventargs e) { // take currency info using currency code given user foreach (var culture in getcultureinfosbycurrencysymbol(this.currencyisocode)) { console.writeline(culture.name); system.threading.thread.currentthread.currentuiculture = cultureinfo.getcultureinfo(culture.name); currentculture = cultureinfo.currentuiculture; culturecurrencysymbol.text = currentculture.numberformat.currencysymbol; regioninfo currentregion = new regioninfo(currentculture.tostring()); culturecurrencycode.text = currentregion.isocurrencysymbol; } } /// <summary> /// validating currency entered user /// </summary> /// <param name="source"></param> /// <param name="args"></param> private void validatecurrencyformat(object source, servervalidateeventargs args) { if (currencytextbox != null) { decimal num; bool isvalid = decimal.tryparse(currencytextbox.text, numberstyles.currency, currentculture, out num); args.isvalid = isvalid; } }
currencyisocode property giving value markup.
how can validation in jquery?
Comments
Post a Comment