Link to home
Start Free TrialLog in
Avatar of Easwaran Paramasivam
Easwaran ParamasivamFlag for India

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
Avatar of guru_sami
guru_sami
Flag of United States of America image

......do all my validation after i tab out the cell.
Use onblur instead of onchange.
Avatar of Easwaran Paramasivam

ASKER

yeah. am sorry. i should have mentioned in the above query itself. yeah i tried with onblur event as well. no luck.

Thanks
Can you share your code that didn't work...it seems some kind of type conversion issue..
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.ssn}_${plan.planId}_${contractID}_${sourceID}_${source.UIName}"                                                                                                      value="${source.contributionAmt}" id="id${contractID}_input_${sourceID}_${source.UIName}" relSrc="${sourceID}_${source.UIName}"                                                                                                 relCtr="${contractID}"  onchange="javascript:calculateTotal('${contractID}','${sourceID}','${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
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
ASKER CERTIFIED SOLUTION
Avatar of Easwaran Paramasivam
Easwaran Paramasivam
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I was able to resolve the issue on my own. please close the question.