Error message on quantity input field

Home Forums Ticket Products Event Tickets Plus Error message on quantity input field

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1101298
    Vivianne
    Participant

    If a user tries to order more tickets for an event than remaining, they get an error message on the input field (here is a screenshot: http://www.directupload.net/file/d/4322/imvcyj2y_png.htm).
    How and where can I change the content (text) of this message element?

    #1101564
    Nico
    Member

    Hi Vivianne,

    Thanks for getting in touch! I’ll help you out…

    First of all, the tickets form seems to be customized or not part of our plugin. Using default tickets form with the latest version of our plugins, I don’t see that message (basically the input goes back to the max quantity if the user inputs a bigger number). Anyway it seems to be a default browsers message, and not one that can be customized. To prevent this message to pop-up, you would need to remove the max attribute of the input element.

    Please let me know about it,
    Best,
    Nico

    #1101814
    Vivianne
    Participant

    I use Events Tickets Plus with Woocommerce and integrated the booking form to the list view with this code:

    function tribe_etp_move_tickets_purchase_form ( $ticket_location_action, $ticket_location_priority = 10 ) {
    	$etp_classes = array(
    		'Tribe__Tickets_Plus__Commerce__EDD__Main',
    		'Tribe__Tickets_Plus__Commerce__WPEC__Main',
    		'Tribe__Tickets_Plus__Commerce__WooCommerce__Main'
    	);
    
    	foreach ( $etp_classes as $ticket_class ) {
    		if ( ! class_exists( $ticket_class ) ) break;
    
    		$form_display_function = array( $ticket_class::get_instance(), 'front_end_tickets_form' );
    
    		if ( has_action ( 'tribe_events_single_event_after_the_meta', $form_display_function ) ) {
    			remove_action( 'tribe_events_single_event_after_the_meta', $form_display_function, 5 );
    			add_action( $ticket_location_action, $form_display_function, $ticket_location_priority );
    		}
    	}
    }
    

    You are right, this is browser specific. It occurs in Chrome.
    But I can´t go further with this message, because it doesn´t appear in the code (so I can´t just put a display:none to it) and it doesn´t let me go the the cart.
    I really need the max-quantity attribute because my client actually wants to have a specific message to appear (similar to the one now) if someone puts more tickets in the cart than available. But we need that as a standard in every browser.
    Can you help me out here?

    #1102159
    Nico
    Member

    Vivianne,

    Thanks for following up, and thanks for including the code you are using, seems to be the right call.

    You can take a look at this article explaining HTML5 default validation and how to modify the default behavior: http://www.html5rocks.com/en/tutorials/forms/constraintvalidation/

    This JS library seems to address that as well: https://github.com/javanto/civem.js

    Please let me know if with these resources you are able to solve the issue,
    Best,
    Nico

    #1108274
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Error message on quantity input field’ is closed to new replies.