PHPBuilder - Remote Scripting with Javascript, IFrames and PHP Page 9



RSS Twitter
Articles Html

Remote Scripting with Javascript, IFrames and PHP - Page 9

by: David Vance
|
May 10, 2004

As a couple of additional notes, once the user selects a value from the list, clicks the submit button and the page is reloaded, the search term and the Select List are de-populated. To get around this, I added the hidden element "listAsStrng" to the form, and set its value in handleResponse() here:

<?php

var = new getObj('listAsStrng');
l.obj.value str;

?>
Now, when the form is submitted, and the page reloaded, the search textbox () and the select list () can be repopulated with their values, maintaining state for the user.
Also, it's possible, if you can track down the source code (remember our principle of copy and paste?), to remove the text box and implement the Select list as a combination editable text box and drop down list. It's a bit hairy and browser specific, so I'll leave this as an exercise for the reader.
So, we now have a fairly fluid implementation of a dynamic drop down using PHP, JavaScript, Remote Scripting, and a bit of copy and paste. Enjoy.

« Previous Page
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
David Vance

Comment:



Comment:

(Maximum characters: 1200). You have characters left.