I searched and searched but could not find anything similar. Pointers if I'm wrong, please.
Not sure how to post this without supplying 'a wall of code'. Code is PHP, javascript ajax, jquery autocomplete function
Using pseudocode...This works perfectly
----start
function <jquery autocomplete> - return term
input jobtype onblur fetchdata (ajax call to render additional inputs based on jobtype chosen)
input sitename - using autocomplete, works perfectly
<additional inputs rendered from ajax call here>
---end
Autocomplete will not work in this scenario:
----start
function <jquery autocomplete> - return term
input jobtype onblur fetchdata (ajax call to render additional inputs based on jobtype chosen)
</start additional inputs rendered from ajax call here>
input sitename - using autocomplete, doesn't work at all
additional ajax rendered inputs here
</end additional inputs>
---end
Also tried this unsuccessfully
Autocomplete will not work in this scenario:
----start
input jobtype onblur fetchdata (ajax call to render additional inputs based on jobtype chosen)
</start additional inputs rendered from ajax call here>
function <jquery autocomplete> - return term
input sitename - using autocomplete, doesn't work at all
additional ajax rendered inputs here
</end additional inputs>
---end
So, if I have the site name field on the page, autocomplete works, so the code isn't broken.
If I try to render the site name input along with others, autocomplete will not work. Nothing happens, no errors, nothing. I tried rendering the function along with the field which did not work either.
When I used firebug to inspect the page upon the ajax call rendering, everything looked perfect which is the confounding part.
I'll provide code if the issue is not apparent in my method...
This is the js function. Maybe I need to add something to allow it to work with ajax rendered inputs?
<script>
$(function() {
$( "#sitename" ).autocomplete({
source: 'acsitename.php'
});
});
</script>
TIA for any help.