Brad,

Thanks for that. Now it's clearer. The problem is we've got a rather
complicated page.  It is a mix of check boxes, radio buttons, and drop down
boxes.  To explain a little more (We're going to be using it in other pages
as well) the page is displaying tasks for the user who has logged in.  They
will be able to change the following options such as to show options for
that week or month or year (drop down) then to show completed tasks only
(check box).  From what your saying we can only get away without a submit
button if we have only checkboxes. How do we get around this?  We're trying
to replicate to a certain extent the environment they have in the actual 4D
system.  They want to be able to select to show all the completed tasks by
selecting the check box, and then selecting to show the tasks only for that
week without having to press a submit button.  I want to be able to tell the
page to run a Query when the checkbox is selected, when the option on the
drop down is selected. Etc....

Thanks

--
Eytan


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brad Perkins
Sent: Monday, March 21, 2005 7:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [Active4d-dev] Check box


>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/


_______________________________________________
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