1

I have created a content type 'Property', has fields 'Property name','Address line1','Address line2','Address line3'.

I don't want to add duplicate properties in database, so that I want an AJAX call while filling above fields and check is there any property available in database or not with current provided values of fields.

If there is any one result, I want to show it on modal.

The only problem is, Where should I write an AJAX code?, And where will the business logic ?.

Is there any way to do this?. kindly suggest me. thank you.

1 Answer 1

0

You'll need to use a validation function alongside an ajax call to check for validity, you might want to look at other solutions like How to validate and submit a form using AJAX? to get an idea about how this could be done.

If you are using the Addressfield module (D7) you may find some of these problems are already taken care of, or are easier to solve than with a standard set of input fields.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.