Help...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

finsta
Forum Newbie
Posts: 10
Joined: Fri Jun 13, 2003 7:22 pm

Help...

Post 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?
Last edited by finsta on Fri Jun 13, 2003 8:40 pm, edited 1 time in total.
Paddy
Forum Contributor
Posts: 244
Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:

Post by Paddy »

If you can't find a solution may I suggest a java applet instead.
finsta
Forum Newbie
Posts: 10
Joined: Fri Jun 13, 2003 7:22 pm

Post by finsta »

uhh....please not Java
Paddy
Forum Contributor
Posts: 244
Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:

Post by Paddy »

Well Java has keylisteners as well as carat pointers. Would be easily done.
finsta
Forum Newbie
Posts: 10
Joined: Fri Jun 13, 2003 7:22 pm

Post by finsta »

ok so tell me...
Paddy
Forum Contributor
Posts: 244
Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:

Post 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.
finsta
Forum Newbie
Posts: 10
Joined: Fri Jun 13, 2003 7:22 pm

Post by finsta »

I'll try, thanks anyways...
Paddy
Forum Contributor
Posts: 244
Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:

Post by Paddy »

Try explaining with a bit more detail what you are trying to do. There may ba another solution.
finsta
Forum Newbie
Posts: 10
Joined: Fri Jun 13, 2003 7:22 pm

Post by finsta »

Here it is, simpler....When someone pushes enter on the fly, I want it to simply add some text....
Paddy
Forum Contributor
Posts: 244
Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:

Post by Paddy »

'Enter' now? It was the 'space' key before in your original description.
finsta
Forum Newbie
Posts: 10
Joined: Fri Jun 13, 2003 7:22 pm

Post by finsta »

Mistakes, My friend...Mistakes....I appologize for my mistake.
Paddy
Forum Contributor
Posts: 244
Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:

Post 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?
finsta
Forum Newbie
Posts: 10
Joined: Fri Jun 13, 2003 7:22 pm

Post by finsta »

enter key, and replace it with an html tag...It's for a guestbook, I'm working on...
Paddy
Forum Contributor
Posts: 244
Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:

Post by Paddy »

So there is some sort of submit button?
finsta
Forum Newbie
Posts: 10
Joined: Fri Jun 13, 2003 7:22 pm

Post by finsta »

yes, there is a submit button
Post Reply