• rogerbattersby

    (@rogerbattersby)


    What changes would I need to make so the selected post title shows up in the box (rather than it being a direct link to the post)?

    I want the user to search, select a post, the post title to show up in the box, and the user to stay on the same page with the post_id for example being passed to another function.

    I guess this would essentially become more like a select box with search functionality?

    https://www.ads-software.com/plugins/ajaxy-search-form/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Naji Amer

    (@n-for-all)

    you need to modify the plugin script for this to work, please be more specific of what u are trying to achieve and what is the function that will be called when you click on the post title?

    Thread Starter rogerbattersby

    (@rogerbattersby)

    Rather than a function being executed, could the post_title populate the search box and the post_ID be the search box “value”, similar to a html select box that has the selected option value hidden?

    This would replace a Select box I’m currently using in a larger form, which works fine now, but will need to use an Ajax search when the number of posts gets too large for a select box.

    Plugin Author Naji Amer

    (@n-for-all)

    u can customize the templates from backend and remove href and add onclick to the post title link and so when you click the post title it will execute the onclick function instead of browsing the link

    is that what u need?

    Thread Starter rogerbattersby

    (@rogerbattersby)

    Yep sounds good! Id already removed the a href.

    So think now its just a case of
    1) Write onclick function to populate searchbox
    2) Add onclick function to post title in place of a href
    3) Pass post id

    for 3) i guess the best thing to do is have a hidden form element alongwith the searchbox, who’s value is set by the onclick function in 1) ?

    And are the only plugin files i need to alter:
    /sf.php
    /js/sf.js?

    Thanks!

    Plugin Author Naji Amer

    (@n-for-all)

    why do u want to edit sf.php, u can change the template from the backend

    as for the js, no need to edit sf.js either, just add the functions in your theme or somewhere else

    Thread Starter rogerbattersby

    (@rogerbattersby)

    Oh yeah – thats much better – not used to plugins being this nice to edit.

    Cheers!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display selected Post Title in searchbox’ is closed to new replies.