Created a Conditional Edit Box
-
I had a need for a text box that could be edited if it’s default value was blank but be read-only if it contained a value (supplied through a parameter in the URL). The “uneditable” tag did not work because the field was always read-only. I made the following two line change to the “uneditable” tag code and create a new “editifblank” tag as follows:
if(in_array('uneditable', $options)){ $readonly = 'readonly="readonly"'; } elseif(in_array('editifblank', $options) && ( '' !== $value )) { $readonly = 'readonly="readonly"'; }
https://wordpress.org/plugins/contact-form-7-dynamic-text-extension/
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Created a Conditional Edit Box’ is closed to new replies.