Click here to Skip to main content
16,017,833 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello experts,

Kindly help me in solving this problem:

I have created an aspx form.

I am Using JQuery validation engine (http://www.position-relative.net/creation/formValidator/) for validation.

Now, I want to notify the user whether the used id already exists in the database with the same red balloon error tip (default for jquery validation engine).

I searched google and got some tips but I am confused about how to pass arguments to the webmethod involved in the ajaxcall.

This is the code given in github site (http://posabsolute.github.io/jQuery-Validation-Engine/#options/ajaxformvalidation):

JavaScript
"ajaxUserCall": {
    "url": "~/Page.aspx/ajaxValidateFieldUser",
    "extraData": "name=eric",
    "extraDataDynamic": ['#user_id', '#user_email'],
    "alertText": "* This user is already taken",
    "alertTextOk": "All good!",
    "alertTextLoad": "* Validating, please wait"
}


I have understood it in the following way. Please correct me if I am wrong.

1) I have included this block of code in 'jquery.validationEngine.js' file.
2) I have created webmethod 'ajaxValidateFieldUser' in .Page.aspx'. It is as follows:

C#
[WebMethod]
public static bool IsUserAvailable(string username)
{
    if (record does not exist in table) // do not worry about this part of code. It is just for example
    	return true;
    else
    	return false;
}


3) In the userId textbox, I have added the class 'validate[ajaxValidateFieldUser]'.

4) Of course, I have added proper jquery files so that the other validations of JQuery ValidationEngine are working properly.

It is not working. I am not sure how to pass username parameter (which is the input of used id textbox) to the webmethod.

Please help me in getting this work. Please give your reply with codes and theory.

Thanks in advance
Posted
Updated 17-Nov-13 2:18am
v3
Comments
Member 12654327 13-Dec-17 9:15am    
have you find the solution of above problem

1 solution

You can refer the below which explains the same .

http://techbrij.com/username-check-asp-net-jquery-validation[^]

Hope this helps
 
Share this answer
 
Comments
Member 9846371 15-Nov-13 22:13pm    
Thank you so much. It is really a big help.

Could you please send another link in which the same functionality is done using JQuery ValidationEngine plugin of PosAbsolute (http://www.position-relative.net/creation/formValidator/)

To make it simple, please check the following link:

http://codeblow.com/questions/wordpress-username-availability-with-ajax-using-form-validation-engine/

They have done what I wanted but in php. How to do the above in ASP.NET? Please help me. Thanks in advance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900