pls help me … i cant even solve this problem 2 days already …. me is too bad
[U]CALL FUNCTION OF JAVA
function alphaNum(myfield, e, dec)
{
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
// control keys
if ((key==null) || (key==0) || (key==8) ||
(key==9) || (key==13) || (key==27) )
return true;
// numbers
else if (((“0123456789”).indexOf(keychar) > -1))
return true;
[I]// alphabets
else if (((“ABCDEFGHIJKLMNOPQRSTUVWSYZ-#”).indexOf(keychar) > -1)) ( **** HERE
return true;
// decimal point jump
else if (dec && (keychar == “.”))
{
myfield.form.elements[dec].focus();
return false;
}
else
return false;
}
[U]JSP
<td width=”124″ align=”right”><FONT class=”fonttype”><b>Job Plan:</b></FONT></td>
<td width=”5″><font class=”astfont”>*</font></td>
[I]<td width=”120″ height=”19″><html:text name=”myJobPlanPP_JobPlanForm” property=”jp_id” size=”10″ maxlength=”10″ onkeypress=”return alphaNum(this, event)”/></td>[/I]
<td height=”2″ colspan=”10″><html:text name=”myJobPlanPP_JobPlanForm” property=”jp_desc” size=”50″ maxlength=”50″/>
QUESTION:
Italic is the part that need to be changed .. ?
A) How to change input value from whatevercase to UPPERCASE n store into DB ? (Do it in JAVASCRIPT)
SYSTEM REQUIREMENT:
a. User key in input in “text field” (front-end).
b. press ‘Submit’
c. javascript will do validation for Input. (my question)
d. Input successfully stored.
EXPLANATION:
– user can key in upper n lower case in “text field”.
– system will change input into UPPERCASE format.
– only UPPERCASE can support the DB.
thanks alot ?