Avatar of erikTsomik
erikTsomikFlag for United States of America

asked on 

Jquery.validationengine custom validation

I ma using Jquery.validationengine and it works just fine. However, I am trying to validate the email address which has to unique. The problem is I need to pass multiple parameters to the function but plugin does not allow passing inline parametrs.

So I thought that I can use regular ajax call and if it fails display the same balloon message.

The form variables are dynamic (that where the problem is)

 <input id="121" class="validate[maxSize[40]] text-input" type="text" name="121" value="">

<script>

	$(document).ready(function(){
		$('###rc.qry.ID#').keyup(url_check3);
	});
	
	function url_check3(){
		var name = $('###rc.qry.ID#').val();
		if(name.length) {	
			jQuery.ajax({
				type: "POST",
				url: "index.cfm?event=ehHan.check" + "&bodyData=" + name + "&ID=#rc.qry.ID#&type=#rc.qry.datatypeID#" ,
				dataType: "json",
				cache: false,
				success: function(response){
					if (response.recordcount  > 0) {
						$('###rc.qry.ID#').css('border', '3px ##C33 solid');
			
						$("###rc.qry.ID#formError").show();
						$('.error').remove();
						$('###rc.qryGetRegistrationFields.bodyDataDefinitionID#').after('<span class="error"></span>');
						$('.error').text('Please choose a different value because it was used by someone else');
						$('##submit1').attr("disabled", true);
						return false;
					}
					else {
						$('###rc.qry.ID#').css('border', '1px ##AAAAAA solid');
						$('.error').remove();
						$(".formError").hide();
						$('##submit1').attr("disabled", false);
						return true;
					}
				}
			});
		}
	}
	
</script>

Open in new window

jQueryJavaScriptAJAX

Avatar of undefined
Last Comment
leakim971
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of erikTsomik
erikTsomik
Flag of United States of America image

ASKER

BUt this will not trigger the balloon message?
Avatar of leakim971
leakim971
Flag of Guadeloupe image

where to see the page ? Or could you set up a working demo on jsfiddle?
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo