[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Test 2 - is this thing on?


Jonathan Mangin wrote:
First drop-down: <select onBlur="populate_clinicians(['src_id'], ['clin_list']); return true;" name="src_id" id="src_id"> <option value="">&nbsp;</option> .. </select>

Looks like all the examples of using CGI::Ajax I've seen. Is populate_clinicians doing a db lookup? If so, isn't that where $html
 should be defined?  Is it a huge list?

Yes populate_clinicians selects a sub-set from a national list of over
34,000 - far too many to load at first go. It returns a pre-formatted
drop-down menu containing all the clinicians which 'belong' to the
selected src_id (ie hospital) - a couple of hundred or so.

I would use onChange=... since your sub will be invoked that much sooner (milliseconds).

The reason I do that is a little complex, but in summary there are two
ways to arrive at the page containing the sources & clinicians drop-down
menus - one where the source/src_id combination is pre-selected, and the other where it is not. In the first scenario the user probably would not change the pre-selected source so onBlur would not be invoked, whereas onChange is always invoked since I force the cursor onto that field on page load. Hope that a bit clearer than mud!

Dependant drop-down generated by: <div id="clin_list"></div>

In my template I have a placeholder, with instructions.

<div id=doctors> <select name=doctor_id size=1 disabled> <option>Select a Practice </select> </div>

So you're doing something similar? How does this work if the field is
disabled and so inaccessible?
--
Richard Jones
Leeds, UK
mailto:suppressed

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.