سؤال

I am using the inline edit option of Jqgrid and want to add a required select box. The first entry should be "please select" and if the user does not choose any other option than "please select" the grid should consider this field as missing and display the build-in "required field is missing" error message.

This is my definition of the select box so far:

 {
    name: 'selectbox',
    index: 'selectbox',
    width: 100,
    editable: true,
    required: true,
    edittype: 'select',
    formatter:'select',
    editoptions:{
     value: {1:"Pony", 2:"Ronny"}

}

My assumption is that I have to add an option without a value at the beginning of the options block like

<option>please select</option>

Yet I did not managed to do that and I am not sure if this is the right approach at all.

هل كانت مفيدة؟

المحلول

just use <select><option value=''>Please Select</option></select>

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top