Producr codes can contain only uppercase charcters. If lowercase characters are enterd, jqgrid does not convert them to upper case, there is not such option. How to force uppercase conversion of entered characters in jqgrid in inline and form edit modes for text fields ?
Update
I found code in How can I force input to uppercase in an ASP.NET textbox? last answer . This code changes entered character in uppercase in keypress. Is it reasonable to use this by adding keyprees event handler to jqgrid editing controls?
function ToUpper() {
// So that things work both on FF and IE
var evt = arguments[0] || event;
var char = String.fromCharCode(evt.which || evt.keyCode);
// Is it a lowercase character?
if (/[a-z]/.test(char)) {
// convert to uppercase version
if (evt.which) {
evt.which = char.toUpperCase().charCodeAt(0);
}
else {
evt.keyCode = char.toUpperCase().charCodeAt(0);
}
}
return true;
}
Used like so:
<asp:TextBox ID="txtAddManager" onKeyPress="ToUpper()" runat="server"
Width="84px" Font-Names="Courier New"></asp:TextBox>
try:
or
First of all you can use CSS style
text-transform: uppercase
to display the data typed by the user in uppercase:The setting will not change the data itself. So you have to make the corresponding modification additionally. In case of form editing you can use
beforeSubmit
. For example, let us you have column'name'
which you need to hold uppercase. Then you first add the setting oftext-transform: uppercase
indataInit
(see above) and addIn case of inline editing there are no
beforeSubmit
callback function. so you can useserializeRowData
if you have remote data:In case of usage
editurl: 'clientArray'
you can fix the data inaftersavefunc
parameter ofeditRow
andsaveRow
:See the demo.