• MikeKJ

    (@mikekj)


    From a form input
    <label>Date From?<input name=”avail” type=”text”>(yyyy-mm-dd)</label>
    <label>Date To?<input name=”avto” type=”text”>(yyyy-mm-dd)</label>

    Using this as a shortcode
    echo do_shortcode(‘[cfdb-table form=”Initial Application” filter=”strtotime(Available-From) >= strtotime($_POST(avail))&&strtotime(Available_To) <= strtotime($_POST(avto))”]’);

    I get

    div’).each( function () { $(this).html(‘‘ + $(this).html() + ‘‘); }) })(jQuery);

    Looked at https://cfdbplugin.com/?page_id=89#filter and https://cfdbplugin.com/?page_id=1195 and I can’t see anything wrong with the shortcode, the database fieldnames are correct, can you advise me what I have screwed up please?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    Take out all the spaces around <= and =>

    Thread Starter MikeKJ

    (@mikekj)

    Hi Michael, took out the spaces and changed it to
    echo do_shortcode(‘[cfdb-table form=”Initial Application” filter=”strtotime(Available-From)>=strtotime($_POST(avail))&&strtotime(Available_To)<=strtotime($_POST(avto))”]’);

    but I am still getting
    div’).each( function () { $(this).html(‘‘ + $(this).html() + ‘‘); }) })(jQuery);

    Plugin Author Michael Simpson

    (@msimpson)

    That last line is Javascript code but [cfdb-table] does not output Javascript. I don’t know how you are generating that output.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘filtering between $_POST dates’ is closed to new replies.