Re: Notification of listbox selection change

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

 



Larry Martell wrote:

> On Sat, Dec 14, 2013 at 7:00 AM, Tedd Sperling <tedd@xxxxxxxxxxxx> wrote:
>> On Dec 9, 2013, at 3:40 PM, Larry Martell <larry.martell@xxxxxxxxx> wrote:
>>
>>> Is there any way in php to have a function be called when the value of
>>> a listbox selection changes?
>>
>> Larry:
>>
>> Sure, take a look at this:
>>
>> http://php1.net/a/zipcode-states/

The "javascript" *label* at the beginning of the onchange attribute's
value of the select elements is superfluous.  The javascript pseudo
*protocol* is only valid for attributes that expect a URI -- but it
might better be avoided[1].

> Thanks very much for this. I just got around to trying it, and I
> adapted it for my needs and it's basically working. The one issue I
> have is that my request returns a complete new page and I want to
> replace the existing page with that. The problem is that the request
> originates from a frame and when I try and replace the page with the
> response the new page get rendered within the frame. Do you know how
> to replace the entire page with the response?

To relace the current document with a new one, you can use the location
property of the window object[2].  In this case using a XMLHttpRequest
object is not necessary at all.

> I realized this is not really a PHP question, but I wanted to
> continue this thread here as others could benefit from it.

It might be better to separate concerns. :)

[1] <http://pointedears.de/scripts/faq/cljs/#javascriptURI>
[2] <https://developer.mozilla.org/en-US/docs/Web/API/Window.location>

-- 
Christoph M. Becker

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux