Sorry I don't think I explained myself properly. This is not to show/hide
information on the web page itself, but from the 4D database. So for example
in a list of properties a user can select the check box to only show
currently rented properties.  How would we get the checkbox to know to run a
new Query when checked?


As Aparajita and I noted by using an "onclick".

To use a checkbox as an example anytime someone checks/unchecks a checkbox (or toggles a pair or group of radio buttons) the form will resubmit and you will build a query and return results based on all of the checked checkboxes. You'll get the checkboxes by checking the form variables collection (_form) or using "form variables has". You need to consider that other boxes may have been checked so you need to trap and accordingly set them as CHECKED when you redisplay the form and the results.

Aparajita noted:

put onclick="this.form.submit()" in the tag of the checkboxes and radio buttons.

For example

<input name="f_rental_status_cb" type="checkbox" value="rented" onClick="this.form.submit()" />

Note: you can probably optionally use onChange="this.form.submit()".

That is basically saying the same thing as "when I check/uncheck this box automatically click the form's submit button". Actually if your query interface is only composed of criteria checkboxes you won't even need an actual submit button. Of course this won't work if the user has Javascript turned off in which case you will need to put an actual submit button within a noscript tag pair if you want to allow them to manually query. For this to work nicely the database needs to be optimized so that the build queries provide no noticeable overhead.

hth,

-- Brad






_______________________________________________ Active4D-dev mailing list [email protected] http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to