如果我没有任何价值,如何将价值设定为零。 [英] How Do I Set Value To Zero If I Dont Have Any Value.

查看:75
本文介绍了如果我没有任何价值,如何将价值设定为零。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Team,





我有Jquery表格。

我有工资文本框。有时薪水文本框是空的,所以我想把零而不是空工资文本框。



我试过这个但是不行。请帮忙。

customerLoanOcr.Salary == null? customerLoanOcr.Salary:0;

$('#txtSalary')。val(customerLoanOcr.Salary);





谢谢

Harshal Raut

Hello Team,


i have the Jquery Form.
i have salary textbox. sometimes salary textbox is empty so i want to put zero instead of empty salary textbox.

I have tried this but it not works.Kindly help.
customerLoanOcr.Salary == null ? customerLoanOcr.Salary : 0 ;
$('#txtSalary').val(customerLoanOcr.Salary);


Thanks
Harshal Raut

推荐答案

('#txtSalary')。val(customerLoanOcr.Salary);





谢谢

Harshal Raut
('#txtSalary').val(customerLoanOcr.Salary);


Thanks
Harshal Raut


试试这个



它应该是
Try this

it should be
customerLoanOcr.Salary  =  customerLoanOcr.Salary != null ? customerLoanOcr.Salary : 0 ;





如果不起作用试试这个..





if that doesnt works try this..

if (customerLoanOcr.Salary == undefined || customerLoanOcr.Salary == '' || customerLoanOcr.Salary == null)
              customerLoanOcr.Salary = 0;


' #txtSalary')。val(customerLoanOcr.Salary);
('#txtSalary').val(customerLoanOcr.Salary);


这篇关于如果我没有任何价值,如何将价值设定为零。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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