Home › Forums › Quform WordPress › Uppercase and Lowercase
- This topic has 3 replies, 2 voices, and was last updated 11 years, 3 months ago by Ally.
- AuthorPosts
- August 9, 2013 at 3:28 pm #5728braboxParticipant
Hello,
I am using a code supplied to me before that is working great, which submitted form elements come in as UPPERCASE. (https://support.themecatcher.net/forums/topic/caps-lock)
//Upercase code for quote forms
//
function mytheme_form_uppercase($form)
{
foreach ($_POST as $key => $value) {
if (preg_match('/^iphorm_\d+?_\d+?$/', $key) && is_string($value)) {
$_POST[$key] = strtoupper($value);
}
}
}add_action('iphorm_pre_process_1', 'mytheme_form_uppercase');
add_action('iphorm_pre_process_2', 'mytheme_form_uppercase');
I would like to know how to target a specific element (unique id) and make it lowercase.
Example, on form 1 I have Single Line Text elements with the Unique IDs: iphorm_3_240 and iphorm_3_241. I would like to target these so they wont submit in uppercase.
Thank you
August 11, 2013 at 10:43 am #5745AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
August 13, 2013 at 11:40 pm #5787braboxParticipantThank you Ally,
Seems to work fine now.
Just had to add a extra ) at the end of
if (preg_match('/^iphorm_\d+?_\d+?$/', $key) && is_string($value) && !in_array($key, array('iphorm_3_240', 'iphorm_3_241'))) {
Thank you!
August 14, 2013 at 7:48 pm #5801AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.