WordPress.org

Ready to get started?Download WordPress

Forums

Autocomplete with taxonomies (2 posts)

  1. jeezyo
    Member
    Posted 2 years ago #

    I have a front end form, where the user needs to select terms from custom taxonomies. They are non hierarchical. For some reason, this code works fine in other places in my theme, but the problem with this form, is that only the field/taxonomy that is updated last, gets it data saved. and if i remove the autocomplete, and just manually enter terms, they save just fine.

    for instance, i have two fields, majors and degrees.

    the form field looks like:
    <p class="majors_wrap"><label for="majors"><?php _e('Start Typing to Choose Your Majors.</small>', 'appthemes'); ?></label> <input type="text" class="tags text tag-input-commas" data-separator="," name="majors" id="majors" value="<?php if (isset($posted['majors'])) echo $posted['majors']; ?>" /></p>

    and then the autocomplete script looks like:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Of course, where necessary i swap out "degrees" for "majors" but have the code one after the other. Im going crazy trying to figure out what im doing wrong! any help would be tremendously appreciated!

  2. jeezyo
    Member
    Posted 2 years ago #

    oops, guess my code was too long and got moderated. here is the js...
    http://pastebin.com/U1syYxLL

    I know this cant be as hard as im making it and somebody with great jquery skills can probably tell me what im doing wrong in minute :-)

Topic Closed

This topic has been closed to new replies.

About this Topic