Skip to:
Content
Pages
Categories
Search
Top
Bottom

HTML validator – Bad value for attribute action on element form


  • Andrew
    Participant

    @snd26

    On HTML validator https://validator.w3.org/ I have 1 error:

    Bad value for attribute action on element form: Must be non-empty.
    <form action=”” name=”activity-loop-form” id=”activity-loop-form” method=”post”>

    Because in activity/activity-loop there is a form at the bottom with nothing in the action attribute:

    do_action( 'bp_after_activity_loop' ); ?>
    
    <?php if ( empty( $_POST['page'] ) ) : ?>
    
    	<form action="" name="activity-loop-form" id="activity-loop-form" method="post">
    
    		<?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ); ?>
    
    	</form>
    
    <?php endif; ?>

    I searched these forums and someone already mentioned this:
    https://buddypress.org/support/search/Must+be+non-empty./

    I don’t think HTML5 allows the action attribute to be blank.

Viewing 1 replies (of 1 total)

  • Hugo Ashmore
    Keymaster

    @hnla

    I would ignore the “warning” and move on, the form ‘action’ attribute is not explicitly set as required, browsers will work without it being set and return the existing url; personally I prefer it set but…

    I would take care in running validation routines over WP code, you’ll almost certainly receive a lot of warnings from various areas and given most sites are built on a structure of modular third party code, it will be next to impossible to get 100% clean results.

Viewing 1 replies (of 1 total)
  • The topic ‘HTML validator – Bad value for attribute action on element form’ is closed to new replies.
Skip to toolbar