Philo Del Middleston wrote:
[color=blue]
> I've been searching, but apparently not phrasing my search right, so I'm
> going to float a question out here in the meantime...
>
> I'm wondering how to go about refreshing the content of a control (say, a
> selector) without refreshing the page. For example, if I have these selects:
>
> Company: <pick a company>
> Contact: <pick a contact>
>
> When they pick the company, I'd like to refill the contact selector based on
> who works for that company, but I don't want to refresh the form since the
> record hasn't been saved yet.
>
> I know I could use a hidden form or some embedded component to do an HTTP
> pull, but we have a live support app that we use and it seems like it might
> be keeping the connection to the server open until it's unloaded from the
> browser, so I was curious if that's doable, and how big a resource hog it
> is. We'll only have occasional instances where we'd need to do this sort of
> thing, but in those cases it would probably be worth it. I've been poking
> around in the live support code to find out how they do their refreshes, but
> I'm kind of new to PHP and I haven't spotted the answer yet.
>
> Thanks in advance...
>
>[/color]
Sounds a little confusing to me. What it sounds like you want is to make
an onChange event for a SELECT element to display information based on
that option's value. This sounds like you will need to make at least one
HTTP/database request for each of the options - or for each time it's
changed. I'd suggest an iframe element, then in the onChange javascript
method, simply treat the IFRMAE as a named window (similar to in
framesets), and reload its content that way.
However, I think your comments about live support app and open server
connections are confusing me. If you want to make no more subsequent
requests until the data from the form is recorded, you'll have to find
all the possible choices and save the content for those somewhere
(likely with hidden elements) and make them visible when that option was
chosen. However, it would seem to be much more efficient to request the
data according to what the user chose since they aren't likely to go
through every option (or are they?).
--
Justin Koivisto -
spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.