• Hi,

    Noticed each form field has the class attribute added twice to it, generating invalid HTML.

    <input type="text" class="form-control" id="pirate-forms-contact-name" name="pirate-forms-contact-name" class="" placeholder="Your Name"

    From what I can tell, it’s added both in the get_common() function from pirate-forms\includes\class-pirateforms-html.php, as well as inside pirate-forms\public\partials\fields\text.php

    Normally this is not a problem, unfortunately, it brakes our own plugin TranslatePress since we need valid HTML or it fails. We have a workaround for it, however it’s not something we can activate by default simply because it can have side effects.

    Best Regards,
    Cristian

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @sareiodata,

    Thank you for contact us.

    Would you please share a link where I can see the same issue because I’m unable to see the class attribute twice at my end.

    Thread Starter Cristian Antohe

    (@sareiodata)

    Hi,

    The website is currently on localhost, however this is the html:

    
    <div class="pirate_forms_container widget-no" id="pirate_forms_container_default">
    	<!-- header -->
    	
    	<!-- thank you -->
    	
    	<div class="pirate_forms_wrap">
    	<!-- errors -->
    	
    	<!-- form -->
    
    		<form
    			method="post"
    			enctype="application/x-www-form-urlencoded"
    			class="pirate_forms  form_honeypot-on wordpress-nonce-on pirate-forms-contact-name-on pirate-forms-contact-email-on pirate-forms-contact-subject-on pirate-forms-contact-message-on pirate-forms-contact-submit-on pirate-forms-contact-referrer-on pirate_forms_from_form-on"
    					>
    			<div class="pirate_forms_three_inputs_wrap ">
    	
    
    <div class="col-xs-12 pirate_forms_three_inputs form_field_wrap contact_name_wrap col-xs-12 col-sm-6 contact_name_wrap pirate_forms_three_inputs form_field_wrap">
    			<input type="text"  id="pirate-forms-contact-name" name="pirate-forms-contact-name" class="" placeholder="Your Name" required oninvalid="this.setCustomValidity('Enter your name')" onchange="this.setCustomValidity('')" value="" >
    </div>
    
    <div class="col-xs-12 pirate_forms_three_inputs form_field_wrap contact_email_wrap col-xs-12 col-sm-6 contact_email_wrap pirate_forms_three_inputs form_field_wrap">
    		<input type="email" class="form-control" id="pirate-forms-contact-email" name="pirate-forms-contact-email" class="" placeholder="Your Email" required oninvalid="this.setCustomValidity('Enter a valid email')" onchange="this.setCustomValidity('')" value="" >
    </div>
    
    <div class="col-xs-12 pirate_forms_three_inputs form_field_wrap contact_subject_wrap col-xs-12 contact_subject_wrap pirate_forms_three_inputs form_field_wrap">
    			<input type="text"  id="pirate-forms-contact-subject" name="pirate-forms-contact-subject" class="" placeholder="Subject" required oninvalid="this.setCustomValidity('Please enter a subject')" onchange="this.setCustomValidity('')" value="" >
    </div>
    			</div>
    
    	
    
    <div class="col-xs-12 form_field_wrap contact_message_wrap col-xs-12 contact_message_wrap pirate_forms_three_inputs form_field_wrap">
    		<textarea rows="5" cols="30" class="form-control" id="pirate-forms-contact-message" name="pirate-forms-contact-message" class="" placeholder="Your message" required oninvalid="this.setCustomValidity('Enter your question or comment')" onchange="this.setCustomValidity('')" ></textarea>
    </div>
    
    <div class="col-xs-12 form_field_wrap contact_submit_wrap">
    	<button type="submit" class="pirate-forms-submit-button btn btn-primary " id="pirate-forms-contact-submit" name="pirate-forms-contact-submit" class="pirate-forms-submit-button btn btn-primary " placeholder="" >Send Message</button>
    </div>
    <input type="hidden" id="pirate_forms_ajax" name="pirate_forms_ajax" class="" placeholder=""  value="0"><div class="form_field_wrap hidden" style="display: none"><input type="text" id="form_honeypot" name="honeypot" class="" placeholder=""  value=""></div><input type="hidden" id="pirate_forms_from_widget" name="pirate_forms_from_widget" class="" placeholder=""  value="0"><input type="hidden" id="wordpress-nonce" name="wordpress-nonce" class="" placeholder=""  value="5e52d04b71"><input type="hidden" id="pirate-forms-contact-referrer" name="pirate-forms-contact-referrer" class="" placeholder=""  value="https://localhost/tpdemo/wp-admin/plugins.php?plugin_status=active"><input type="hidden" id="pirate_forms_from_form" name="pirate_forms_from_form" class="" placeholder=""  value="b4ab1c4b9e">		</form>
    
    	
    		<div class="pirate_forms_clearfix"></div>
    	</div>
    

    I simply installed the plugin and added the default contact form on a page. No configuration on my part what so ever.

    The elements with the ids: pirate-forms-contact-email, pirate-forms-contact-message, pirate-forms-contact-submit, have two class attributes on them.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Each field has the class attribute added twice’ is closed to new replies.