« I need PHP! | Main | Phew... »

Tuesday, March 22, 2005

Couldn't resist it.

I couldn't resist doing a Google style auto-complete using XMLHttpRequest and the most logical place for this is in the personal message "send" form. Typing in the recipients name will show a drop down box of possible matches which is constantly refined as you enter more characters.

Screenshot here.

March 22, 2005 | Permalink

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83423035953ef00d834458e3053ef

Listed below are links to weblogs that reference Couldn't resist it.:

Comments

wooooow great !!
I already love it.
Matt it is perfect !

Look at this http://www.baekdal.com/x/xmlhttprequest/
It is also usefull that it checks right after having filled out the form that you have typed a wrong email adress for example.
Something like this would be great for the registration page, as the easier and fester it is to registrate, the more user will register.

Posted by: me | Mar 22, 2005 9:02:51 PM

could you integrate this also for "send email" ?
Please...

Posted by: | Mar 22, 2005 9:12:30 PM

Cool !
The PM-send page is always so overloaded with forms.
It would be nice to remove the carbon copy and integrate it in the first form, like it is done at gmail.

Posted by: | Mar 22, 2005 9:37:03 PM

Sweet :)

Posted by: Franklin | Mar 22, 2005 9:43:33 PM

All using a common library? right? :D

Posted by: Chris Griego | Mar 23, 2005 2:50:51 AM

With XMLHttpRequest, you could essentially make a Chat script without using a Language such as, Java or Flash. Correct?

Seeing as it does not refresh the page, you could use PHP and Javascript, with XMLHttpRequest. Thus, removing the need for technology of Java or Flash.

I would be correct in this assumption?

Anyways,
The google thing, personally, would annoy me.
However, with browsers, I find it useful. I could also see the usefulness in this as well.

Posted by: Chad | Mar 23, 2005 4:08:49 AM

"All using a common library? right? :D"

I have a javascript library that I use, yes - and a back end "action_public" script. There really isn't much of a library required. You fire an XMLHttpRequest to a URL and the XML document is available in the DOM namespace.

I do have the javascript XMLHttpRequest functions in a OOP class which is handy.

"It is also usefull that it checks right after having filled out the form that you have typed a wrong email adress for example."

Great idea. I'll definitely consider adding that.

I'm thinking of adding an ACP switch to be able to turn these things off as well as a user side switch to turn these enhancements off.

Posted by: Matt | Mar 23, 2005 8:28:42 AM

So, correct me if I'm wrong, everytime my users load the "send message" page they are also going to be receiving a list of all 10,000 member names.

Hmmm sounds a bit of a bandwidth hog - or perhaps I have it all wrong.

Posted by: Martin | Mar 23, 2005 11:54:21 AM

You have it wrong Martin, that's the boon of the Ajax method is that 10,000 member names are never sent.

Posted by: Chris Griego | Mar 23, 2005 1:08:40 PM

this is also a nice idea (double click for editing):

http://www.ideasfreelance.com/lab/instant_edit/

It could be used at several places for quick edits. For example:

- edit the topic title (for mods) in forum view
- edit own post (normal user) or others posts (for mods)
- skin macros edits (the open process of the popup is fine and instant, but after hitting "edit this macro" the page reloads and bring you at the top of the page, so making 30 edits, reload and always scrolling to the right position again is VERY time consuming)
- ... (templates)

This XMLhttprequest is like a little revolution for web-apps. It makes them a lot closer to desktop applications.
A good use of them (expl 1 and 2) could also increase the mods productivity, which is a vital thing for growing board communitys.

Posted by: | Mar 23, 2005 1:36:16 PM

It's stuff like this that truly puts IPB on a whole other level.

I like the whole idea of making moderation a lot easier, deleting, editing, etc., on the topic view without having to wait for pages to load sounds fantastic.

Bravo Matt.

Posted by: Den Watts | Mar 23, 2005 1:50:48 PM

"So, correct me if I'm wrong, everytime my users load the "send message" page they are also going to be receiving a list of all 10,000 member names."

When a user has typed three letters in the recipients name field, an XML request is fired to IPB which returns a plain text lump of javascript which is eval'd and displayed. The XML request fires the PHP engine which matches 15 names beginning with the string entered sorted by length and alphabetical order. The more you type, the more refined the matches get.

Posted by: Matt | Mar 23, 2005 3:13:12 PM

I really like all this stuff Matt but isn't a little CPU / resource intensive? I mean every time XMLHttpRequest is made, the IPB program PHP engine is run (and usually SQL run). Not so bad in certain cases but refining a name search space every time a new charater is entered could be a little intensive for the server, could it not?

Posted by: Leo | Mar 23, 2005 11:45:31 PM

Chris, Matt.

Thanks for clearing it up - sounds exciting, I'm off to find more information on it.

Cheers

Posted by: Martin | Mar 24, 2005 9:06:24 AM

"- skin macros edits (the open process of the popup is fine and instant, but after hitting "edit this macro" the page reloads and bring you at the top of the page, so making 30 edits, reload and always scrolling to the right position again is VERY time consuming)"

Can't refer to you by name because you didn't leave one, but you should definitely check out the Edit Macros IH hack.

http://www.invisionhacks.com/index.php?p=hacks&act=details&id=104

It doesn't use XMLHttpRequest but it lets you edit as many as you want before sending them to the server, never drags you to the top of the page, and has a live preview as you edit.

Posted by: Chris Griego | Mar 24, 2005 12:34:54 PM

Your hack is truely great !
I won't be able to live (or at least to skin ;-) without it or something similar...)

I still prefer default features, even if this mod is top !

Posted by: mike | Mar 26, 2005 1:27:48 PM

Post a comment