No announcement yet.

sc_field_display Based on query results

  • Filter
  • Time
  • Show
Clear All
new posts

  • sc_field_display Based on query results

    Hello all,
    I am trying to hide/show a field based on query results. The query is polling a different table than what the form is built on. The form has two check boxes, start and stop. Just trying to get 'stop' to hide when data is correct condition then will do the same for 'start'
    Here is what I have so far.

    * Hide/show stop click

    if ('start' == ("SELECT MAX(w_id) FROM ticket_times WHERE t_id = '{t_id}' AND start = (Null)")) // Display field
    sc_field_display({stop}, 'off');
    else // Hide field
    sc_field_display({stop}, 'on');

    The field 'stop' is still being displayed. It is a check box with Ajax event that inserts timestamp and t_id and 'w_id key autoincrement' into ticket_times table. t_id is ticket ID in tickets table. I am building a log of ticket work times. The ticket_times table has w_id auto increment, t_id, emp_id, start (Timestamp), stop (Timestamp) and each click on start or stop inserts new record with timestamp into either start or stop column along with t_id.

    Bottom line, can sc_field_display be used with a query? Attached is screen shot of ticket_times table.
    Attached Files