This is a continuation of an earlier post. Unfortunately, The solutions posted didn't work and my follow up questions weren't addressed. Just in case this is because my generous respondents didn't notice I had replied, I'm reposting my problem.
I'm trying to build a form where certain text fields and text areas have autocomplete.
I've used the formidable plugin for wordpress to build my form. I'm using the jQuery autocomplete plugin for the autocomplete part.
After implementing the suggestions of one of my respondents, the code now looks like this:
<script>
$(document).ready(function(){
<?php global $frm_entry_meta;
$entries = $frm_entry_meta->get_entry_metas_for_field(37, $order=''); ?>
var data = new Array(); <?php foreach($entries as $value){ ?>
data.push(unescape('<?php echo rawurlencode($value); ?>');
<?php } ?>
$("#field_name-of-the-school").autocomplete(data); })
</script>
// 37 is the field id I want to pull from in the database,
// and #field_name-of-the-school is the css id
// for the text field in the form where a user can enter the name of a school.
// the data for that field is stored in the db under field id 37.
// other fields, like school id, have their own field ids.
My respondent suggested adding the data.push(unescape('<?php echo rawurlencode($value); ?>');
bit. Unfortunately, it's still not working.
BTW, the code is in the body of page.php, a template which wordpress uses to generate static pages (the form is on one of these).
I would seriously, seriously appreciate any and all help with this. If this approach is a dead end (on the earlier posts, there were two other answers that were over my head,) I would be more than willing to learn some new tricks (though it would really help to be pointed to a relevant learning resource.)
Thanks in advance.