Page 1 of 2
Help...
Posted: Fri Jun 13, 2003 7:22 pm
by finsta
I have a form where users can type, when they push enter I want it it to input something. Does anyone know how to do it?
Posted: Fri Jun 13, 2003 7:50 pm
by Paddy
If you can't find a solution may I suggest a java applet instead.
Posted: Fri Jun 13, 2003 7:52 pm
by finsta
uhh....please not Java
Posted: Fri Jun 13, 2003 7:55 pm
by Paddy
Well Java has keylisteners as well as carat pointers. Would be easily done.
Posted: Fri Jun 13, 2003 8:19 pm
by finsta
ok so tell me...
Posted: Fri Jun 13, 2003 8:29 pm
by Paddy
What exactly are you trying to do? I am asking because if you need to replace the space with text but NOT on the fly then you could do that in PHP using str_replace()
http://au2.php.net/manual/en/function.str-replace.php
If you need to do it on the fly then maybe someone else can help you. If you can not find an answer and you know a little about java then keylisteners are explained at
http://java.sun.com/j2se/1.4.1/docs/api ... tener.html
And carat pointers at
http://java.sun.com/j2se/1.4.1/docs/api ... Caret.html
And string manipulation at
http://java.sun.com/j2se/1.4.1/docs/api ... tring.html
Hope it all helps.
Posted: Fri Jun 13, 2003 8:30 pm
by finsta
I'll try, thanks anyways...
Posted: Fri Jun 13, 2003 8:32 pm
by Paddy
Try explaining with a bit more detail what you are trying to do. There may ba another solution.
Posted: Fri Jun 13, 2003 8:32 pm
by finsta
Here it is, simpler....When someone pushes enter on the fly, I want it to simply add some text....
Posted: Fri Jun 13, 2003 8:34 pm
by Paddy
'Enter' now? It was the 'space' key before in your original description.
Posted: Fri Jun 13, 2003 8:40 pm
by finsta
Mistakes, My friend...Mistakes....I appologize for my mistake.
Posted: Fri Jun 13, 2003 8:56 pm
by Paddy
Ok, I am starting to get what you want it to do. So when they hit enter is it via the enter key or via an enter button? And when you say you want it to input something what do you mean by that?
Posted: Fri Jun 13, 2003 8:57 pm
by finsta
enter key, and replace it with an html tag...It's for a guestbook, I'm working on...
Posted: Fri Jun 13, 2003 9:02 pm
by Paddy
So there is some sort of submit button?
Posted: Fri Jun 13, 2003 9:05 pm
by finsta
yes, there is a submit button