Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter thatdiegokid

    (@thatdiegokid)

    wiped userscripts.js
    and modified formelements/formelements.php
    to this

    function fe_getInputHTML($elementDef){
    	global $wpdb;
    	$query_results = $wpdb->get_results('SELECT required FROM wp_fm_items WHERE <code>unique_name</code> = "'.$elementDef['attributes']['name'].'"');
    
    	$required = "";
    	if ($query_results[0]->required == '1'){
    		$required = " required";
    	}
    
    	$str = "<input type=\"".$elementDef['type']."\" ".fe_getAttributeString($elementDef['attributes']).$required.">";
    
    	return $str;
    }

    Good idea, thanks for sharing. It appears to require an updated browser that understands HTML5, but that would basically be the same as a browser that runs jQuery. Your method is better for modern browsers in that it does not depend on JavaScript.
    Perhaps this could be built in to the plug in as an option HTML5/JavaScript validation?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Replacing Validation JS with jquery.validate.js’ is closed to new replies.