How do I test if the string has atleast one numerical character rather than test if the whole string is a number?
This is the current code. It works in the following scenarios: If there is one integer e.g. "43" will display the text corresponding to row 43 in the DB. If there is a plain text e.g. "None" will display the label "none"
When I have more than one integer comma seperates e.g. "43,82" it will display as "43,82" instead of the corresponding rows.
Jquery:
if(!isNaN(parseFloat(gestures[gesture_key].confirming)) && isFinite(gestures[gesture_key].confirming)){ var confirming = gestures[gesture_key].confirming.split(','); for(var i=0;i<confirming.length;i++){ // Find the name of the gesture for(var j=0;j<gestures.length;j++){ if(gestures[j].id == confirming[i]){ var gesture_name_key = j; var absense = false; } if(gestures[j].id == -1 * confirming[i]){ var gesture_name_key = j; var absense = true; } } if(!absense) { $("ul#confirming_gestures").append("<li class=\"gesture\" value="+confirming[i]+">"+gestures[gesture_name_key].name+"</li>"); } if(absense) { $("ul#confirming_gestures").append("<li class=\"gesture\" value="+confirming[i]+">Absense of "+gestures[gesture_name_key].name+"</li>"); } } } else { $("ul#confirming_gestures").append("<li>"+gestures[gesture_key].confirming+"</li>"); }