Time button clear field / add custom button to form

This topic contains 9 replies, has 5 voices, and was last updated by  Stiofan O’Connor 7 years, 12 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #185511

    sumi
    Expired Member
    Post count: 97

    Hi there,

    I have default values but want to give option to customer to clear fields.
    On form, once you have a value in ‘Time’ button it does not allow you to clear it!

    Is there a way to do this? Do I need to add a custom button, please?

    I was thinking about following, but have no idea.

    <button type="reset" onclick="' . $jquery . '">Reset Field</button>

    and code

    
    
    //reset button
    add_filter( 'custom_clear_button', 10, 2 );
    function custom_clear_button( $button_html, $comment_id ) {
    	$jquery = sprintf( "jQuery( '#geodir_mondaystart1%d textarea' ).val( '' );", $comment_id );
    	return $button_html;
    }
    #185526

    Guust
    Moderator
    Post count: 29970

    How are you adding the default value?
    At GD > Place settings > custom fields > Time field > default value?

    #185572

    sumi
    Expired Member
    Post count: 97

    Hi,
    Yes, but I wanted option there because even if field is clear initially, if you click inside and choose a time, it wont let you clear it once it has a value

    #185599

    Guust
    Moderator
    Post count: 29970

    I see. Even without entering a default value, once you click on the field, you cannot empty the field again.
    Let’s ask the others to see if that can be changed or not.

    #185801

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I’ve flagged this for the developers.

    They’ll let us know as soon as it is fixed.

    Thanks

    #187001

    Giri
    Expired Member
    Post count: 3155

    could you give me url to your form and login credentials?

    #187120

    sumi
    Expired Member
    Post count: 97
    This reply has been marked as private.
    #187699

    Giri
    Expired Member
    Post count: 3155

    Looks like you are talking about “BUSINESS HOURS” addon. Thats a third party addon. That plugin not included in our membership. You have to contact its author Jeff. http://sfcplugins.com/contact-us/

    #187780

    Giri
    Expired Member
    Post count: 3155

    My mistake. @guust clarified that you created all those fields with custom fields. I’m working on that bug. thanks

    #187795

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    There is no option in the script to be able to clear this: http://trentrichardson.com/examples/timepicker/#input_examples

    You would have to add a foreach loop to then maybe add a button after each fiels that when clicked clears the field.

    Stiofan

Viewing 10 posts - 1 through 10 (of 10 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket