c# - JavaScript subtract elements from string -
i sending javascript function string c# "11-2-2013", , expect in javascript function string, gating 11 - 2 - 2013 = -2004.
c# code:
string id = 11 + '-' + 2 + '-' + 2013; textboxbo.attributes.add("onblur", "textboxreset(this," + id + ")");
javascript code:
function textboxreset(txt, id) { if (txt.value > 0) { var textboxrr = document.getelementbyid("contentplaceholder1_txtrr" + id); textboxrr.value = 0; } }
how tell javascript not subtract element string.
you have set date in quotes:
textboxbo.attributes.add("onblur", "textboxreset(this,\"" + id + "\")");
if not set in quotes, rendered textboxreset(this, 11-2-2013)
, result in -2004
.
c# javascript
No comments:
Post a Comment