Easwaran Paramasivam
asked on
Input validation during onChange results NAN
Team,
am facing an issue during my edit page where i have a text box gives me a trouble during validation.
I am calling an onchangeTotal() function , when ever there is a change in value via onchange event. when ever there is a text entered , the total column is updated dynamically. i would like to prevent it . do all my validation after i tab out the cell.
because when there is an invalid value entered , i need to print ***** in the total section based on the value.
i have attached a screen shot where it updates the total section with Nan.
Please help.
validate.JPG
am facing an issue during my edit page where i have a text box gives me a trouble during validation.
I am calling an onchangeTotal() function , when ever there is a change in value via onchange event. when ever there is a text entered , the total column is updated dynamically. i would like to prevent it . do all my validation after i tab out the cell.
because when there is an invalid value entered , i need to print ***** in the total section based on the value.
i have attached a screen shot where it updates the total section with Nan.
Please help.
validate.JPG
onblur instead of onchange.
Use ASKER
yeah. am sorry. i should have mentioned in the above query itself. yeah i tried with onblur event as well. no luck.
Thanks
Thanks
Can you share your code that didn't work...it seems some kind of type conversion issue..
ASKER
Sorry for the delay.
I have added the code snippet for the input text:
input type="text" class="inputs txtr" maxLength="12" name="txt_${participant.ss n}_${plan. planId}_${ contractID }_${source ID}_${sour ce.UIName} " value="${source.contributi onAmt}" id="id${contractID}_input_ ${sourceID }_${source .UIName}" relSrc="${sourceID}_${sour ce.UIName} " relCtr="${contractID}" onchange="javascript:calcu lateTotal( '${contrac tID}','${s ourceID}', '${source. UIName}')" />
</div>
I have uploaded the JSP page as HTML and JS script page as well.
Please do let me know if you need any additional info to dig this issue.
Thank you
EditJSP.html
EditJS.js
I have added the code snippet for the input text:
input type="text" class="inputs txtr" maxLength="12" name="txt_${participant.ss
</div>
I have uploaded the JSP page as HTML and JS script page as well.
Please do let me know if you need any additional info to dig this issue.
Thank you
EditJSP.html
EditJS.js
ASKER
Team,
I have an validation in place to report when we enter invalid value in the text box.
various conditional check to NAN & < 0 and so on.
The point here is that when i enter the value in the text box and tab out it , validation is not occurring and when i enter value and click on any place in the web page it works and prints **** in the total section.
attached the screen print to have some details on the issue.
Can someone point out the issue with the script?.
Thanks
validation-issue.JPG
I have an validation in place to report when we enter invalid value in the text box.
various conditional check to NAN & < 0 and so on.
The point here is that when i enter the value in the text box and tab out it , validation is not occurring and when i enter value and click on any place in the web page it works and prints **** in the total section.
attached the screen print to have some details on the issue.
Can someone point out the issue with the script?.
Thanks
validation-issue.JPG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was able to resolve the issue on my own. please close the question.