Join Page - adding a message box on error

On the join page, if a user does not fill in a mandatory field and clicks submit, the page just sits there. So the user has to know to scroll up and see what field is highlighted red. I think most users will not know to scroll up and will just think the page is malfunctioning. Is there a way to add a message box that pops up letting the user know that there is a field that needs correcting?

Quote · 5 Apr 2010

js/join.js

There is code to display errors built in, but commented out.

function doShowError( eForm, sField, iInd, sError ) {
var $Field = $( "[name='" + sField + "']", eForm ); // single (system) field
if( !$Field.length ) // couple field
$Field = $( "[name='" + sField + '[' + iInd + ']' + "']", eForm );
if( !$Field.length ) // couple multi-select
$Field = $( "[name='" + sField + '[' + iInd + '][]' + "']", eForm );
if( !$Field.length ) // couple range (two fields)
$Field = $( "[name='" + sField + '[' + iInd + '][0]' + "'],[name='" + sField + '[' + iInd + '][1]' + "']", eForm );

//alert( sField + ' ' + $Field.length );

$Field.parents('td:first').addClass( 'error' );

$Field
.parents('td:first')
.addClass( 'error' )
.children( 'img.warn' )
.attr('float_info', sError)
//.show()
;
}


It's not written well. Should be something like alert( sField + ' is required.');

It also will reappear for each missing field it find which could be a pain.


https://www.deanbassett.com
Quote · 5 Apr 2010

Again. D6. Got to pay more attention. But lucky this code is in both d6 and d7

https://www.deanbassett.com
Quote · 5 Apr 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.