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.

enter image description here

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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -