Forum Replies Created
- AuthorPosts
polanko
ParticipantPerfect ; )
Thanks a lot!!polanko
ParticipantHi,
That works pretty well for the datepicker, thanks a lot!
¿What about the dropdown “month”?
Regards
polanko
ParticipantCool ; )
polanko
ParticipantGot it!!
I had an obvious php syntax problem that I solved this way:
add_action('iphorm_pre_display_4', 'mytheme_fix_time', 10, 1);function mytheme_fix_time($form)
{
// Sets the default time to HH:MM
$time = $form->getElement('iphorm_4_21');
$time->setValue(array('hour' => '', 'minute' => '', 'ampm' => 'am'));
$time = $form->getElement('iphorm_4_22');
$time->setValue(array('hour' => '', 'minute' => '', 'ampm' => 'am'));}
add_action('iphorm_element_valid_iphorm_4_21', 'mytheme_validate_time', 10, 3);
add_action('iphorm_element_valid_iphorm_4_22', 'mytheme_validate_time', 10, 3);
I don’t know It’s the best way but It works.
Thanks again for your awesome support.Attachments:
You must be logged in to view attached files.polanko
ParticipantGreat! Now time elements work exactly like I want. Thank you!!
I have 2 time elements (start time and end time).
So I have two “Time element unique ID”
¿How should I code that?
function mytheme_fix_time($form)
{
// Sets the default time to HH:MM
$time = $form->getElement('iphorm_1_11');
$time->setValue(array('hour' => '', 'minute' => '', 'ampm' => 'am'));}
add_action('iphorm_element_valid_iphorm_1_11', 'mytheme_validate_time', 10, 3);
Imagine both cases:
$time = $form->getElement(‘iphorm_1_11’); >>>>> & iphorm_1_12
add_action(‘iphorm_element_valid_iphorm_1_11’, ‘mytheme_validate_time’, 10, 3); >>>>> & iphorm_1_12Thank you so much!!
polanko
ParticipantHi Ally,
The hour validation works fine, but the minute one does not work.
In fact, you can set the time this way: “23:MM” and submit the form successfully.
But when you don’t set the minutes (and leave MM), something sets them randomly and also breaks the hour previously set)So, the “23:MM” submitted could become “9:22” (?) in the email you received.
Thanks.
polanko
ParticipantThanks again.
Now, HH&MM values appear fixed in drop-down. That’s great.
But some problem remains the same, Quform takes those values (HH&MM) and when you submit the form, It doesn’t require real time values.Please, take a look at the attached image.
Attachments:
You must be logged in to view attached files.polanko
ParticipantThanks ; )
Now, I can view the HH&MM in the drop-down list, but It’s not possible to set it like the default value (via Form builder UI).
I tryed the following code but It didn’t work.
<option value="" selected>MM</option>
- AuthorPosts