【发布时间】:2021-06-29 15:04:58
【问题描述】:
您好,我试图将页面上的文本框设为只读,我尝试了我认为足够的方法,但文本框仍然可写,我仍然感到困惑,不知道我错过了什么。
我试着写
'readonly' => true,
'readonly' => 'true',
'readonly' => 'readonly',
一切都没有为我工作:(
function my_custom_checkout_field( $checkout ){
echo '<div id="EATM_custom_checkout_field">';
echo '<input class="EATM_checkout_exchange_rate" value="'.$this->exchange_data['EATM_exchange_rate'].'" hidden/>';
echo sprintf('<div class="EATM_container-payments"><div class="EATM_container-image-checkout"><img src="%1$s" /></div>',$this->payment_images[ str_replace(' ','_',$this->exchange_data['EATM_payment_send_from']) ] );
echo "<div class='payment'>";
woocommerce_form_field( 'my_field_name_1', array(
'type' => 'text',
'class' => array('my-field-class form-row-wide'),
'label' => __('ارسال'),
'required' =>true,
'readonly' =>true,
'value' =>$this->exchange_data['EATM_payment_send_from'],
'placeholder' => __('Send'),
), $this->exchange_data['EATM_payment_send_from']);
【问题讨论】:
标签: php html forms woocommerce