php和ajax中的数字格式问题 [英] number formating problem in php and ajax

查看:51
本文介绍了php和ajax中的数字格式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个采用以下语法格式的文本框

i have one text box formated with follwoing syntax

       $("#cont_dt").blur(function(){
      $(this).format({format:"#,###.00", locale:"us"}); 
        })  

这项工作正常,例如,如果我键入250000.50,它将自动格式化为

this work fine, for example if i type 250000.50 it automatically formated to

    250,000.50

但是问题是当我尝试通过ajax将相同的值传递给php文件以在mysql中添加记录时 我出错了.

but the problem is when i try to pass same value to php file via ajax to add record in mysql i got error.

我认为我需要再次以250000.50格式带入250,000.50才能存储在mysql中.

i think i need to bring 250,000.50 again in 250000.50 format to store in mysql.

我该怎么做?

谢谢

          **EDIT**

亲爱的我需要删除ajax/java脚本函数,而不是php函数. 谢谢你的帮助

dear all i need ajax / java script function to remove , not php function. thanks for help

推荐答案

简单地.format()元素onSubmit

simply .format() the element onSubmit

这篇关于php和ajax中的数字格式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆