elclanrs / jq-idealforms-old

The ultimate framework for building and validating responsive HTML5 forms.
665 stars 95 forks source link

How to integrate jQuery.autocomplete #156

Open entenbraten opened 11 years ago

entenbraten commented 11 years ago

Hello,

I'd like to integrate jQuery.autocomplete for a formular input, which is validated by idealforms. My code example:

<form id="mainform" class="mainform"> <div><label for="autocompleteinput">Input:</label><input id="autocompleteinput" name="autocompleteinput" type="text" placeholder="e.g. Input"/></div> </form>

var $mainform = $('#mainform').idealforms({ 'autocompleteinput': { filters: 'required ajax', data: { ajax: { url: 'myurl.php' } } }}).data('idealforms');

$("#autocompleteinput").autocomplete(...);

if I type "xyz" into the autocompleteinput field, the jQuery autocomplete menu appears. I choose one value and the value of the autocompleteinput field is set to the choosen value. However, idealforms didn't notice that something was written into the input field. So the valdation fail. My questions: How can i tell idealforms to check the current value, which was written into the input field via jQuery?

I tried to trigger an event, like keyup, blur, focus etc. on the input field: nothing. I tried to change the span class via jQuery to valid etc. Nothing works fine. Any suggest, what I can do? I am looking for a method to tell idealform that there is a new value. fresh () etc. doesn't work either.

Thank you for any hint. :)