I want to allow only numbers for a certain input field in a Magento Admin Control-Table/Config-Table. Has anyone done that before or has a hint?
Greez
I want to allow only numbers for a certain input field in a Magento Admin Control-Table/Config-Table. Has anyone done that before or has a hint?
Greez
You have to added validation class.
$this->addColumn('yourfieldname', ['label' => __('Your Label'),'class' => 'required-entry validate-number']);
In store configuration fields, you can use below code to allow numbers only
<config>
<sections>
<newsletter translate="label" module="newsletter">
<label>Custom Label</label>
<tab>phone</tab>
<frontend_type>text</frontend_type>
<sort_order>110</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<validate>validate-number</validate>
</newsletter>
</sections>
</config>