robert_f
asked on
get first characters in form
the script below passes a form entry to a hidden field...
<script language="JavaScript"><!--
function copyData(from,to) { to.value = left(from.value),2; }
//--></script>
how can I get this to copy just the first two characters
<script language="JavaScript"><!--
function copyData(from,to) { to.value = left(from.value),2; }
//--></script>
how can I get this to copy just the first two characters
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.w3schools.com/jsref/jsref_obj_string.asp
You could use
1. substr
2. substring
3. charAt
..
...
Amit