Why is the error message showing on page load?

Former Member
Former Member

I was wondering why the following required field error message is showing when the page loads initially (before the submit button is pressed):

Here is the JavaScript/Jquery:

           _addValidation = function(context) {
        var w = $('#' + context.wrapperId);
        var saveButton = $('a.update-user', w);
        
        saveButton.evolutionValidation({
            onValidated: function(isValid, buttonClicked, c) {
                if (isValid)
                    saveButton.removeClass('disabled');
                else {
                    //saveButton.addClass('disabled');
                    //$.telligent.evolution.notifications.show(context.formIncompleteText, {type:'error'});
                }
            },
            onSuccessfulClick: function(e) {
                $('.processing', saveButton.parent()).css("visibility", "visible");
                saveButton.addClass('disabled');
                _save(context);
	            if (context.registration) {
	                   if (_getAccountType(context) != "Other")
	                       _saveUploads(context);
	                var qstring = "email="+context.email+"&UserId="+context.userId+"&AccountType="+_getAccountType(context);
	                var encoded = window.btoa(qstring);
	                window.location.href = context.exitUrl + "?" + encoded;
	            }
	            else
	                window.location.href = context.exitUrl;
            }
        });
       
            saveButton.evolutionValidation('addField',
             context.bio,
            {
                required: true,
            },
            $(".bio").closest('.field-item').find('.field-item-validation'));

Here is the HTML:

   		  <li class="field-item">
    			<label class="field-item-name" for="$core_v2_widget.UniqueId('DisplayName')">Bio/Company Info:</label>
    			<span class="field-item-input">
    			    <textarea name="$core_v2_widget.UniqueId('UserBio')" id="$core_v2_widget.UniqueId('UserBio')" rows="8" cols="40" maxlength="10000" class="bio">$!core_v2_encoding.HtmlAttributeEncode($user.Bio())</textarea>
    			</span>  
				<span class="field-item-validation" style="display: none;"></span> 
    		</li>

Parents Reply Children
No Data