Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field with numbers and characters get nan

Status
Not open for further replies.

edgarv

MIS
Jul 25, 2003
248
US
Hello,
I have the code below
where the "day" field is coded as digits and numbers, for example
Day Code
1 = 1
2 = 2
3 = 3
4 = 4
5 = 5

but after 5
it the code changes to a letter
6 = A
7 = B
and so on, if the user types a number I have no issues but if the user types a letter then I get "nan", is there a way to handle this so I get the correct code?
<code>
<script type="text/javascript">
function generateFullName()
{
document.getElementById('joint').value =
document.getElementById('rnd').value + document.getElementById('usmade').value +
document.getElementById('year').value + document.getElementById('month').value + + document.getElementById('day').value;

}
</script>




<td bordercolor="#000033" bgcolor="#FFFFFF"><div align="center">
<input name="joint" id="joint" type="text" size="15" maxlength="100" onChange="javascript:this.value=this.value.toUpperCase();" />
</div></td>
</code>


In advance, thank you for any help or pointing me in the right direcction
 
suspect its trying to do arithmetic calculations and gets an issue with character, you may need to investigate Casting to ensure that the calculation is done as Strings.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top