Alaska Software Inc. - focus on HTML page?
Username: Password:
AuthorTopic: focus on HTML page?
focus on HTML page?
on Fri, 26 Aug 2005 09:22:16 +0200
Hello,

I'm creating a HTML page with Xbasee++ which contains 3 buttons and an input
field.  Everything is working correct.  One thing that I can't complish is
the focus.

When the page is shown in the browser, it would be easy for the user if the
focus is already in the input field.  So she/he can enter the data
immediately, without clicking in the field first.

Anyone who knows if this is possible?

Bye,

Chris Andries.
Allen LeeRe: focus on HTML page?
on Fri, 26 Aug 2005 01:40:31 -0700
This little example demonstrates one way ...




set_focus.htm
Re: focus on HTML page?
on Fri, 26 Aug 2005 11:03:50 +0200
Re: focus on HTML page?
on Fri, 26 Aug 2005 11:33:44 +0200
Phil Ide
Re: focus on HTML page?
on Fri, 26 Aug 2005 10:42:09 +0100
Chris,

> I'm creating a HTML page with Xbasee++ which contains 3 buttons and an input
> field.  Everything is working correct.  One thing that I can't complish is
> the focus.
> 
> When the page is shown in the browser, it would be easy for the user if the
> focus is already in the input field.  So she/he can enter the data
> immediately, without clicking in the field first.
> 
> Anyone who knows if this is possible?

Easy as pie.

<form name="myform" ...>
  <input type="text" name="input1">
</form>

<script>
document.myform.input1.focus()
</script>


Regards,

Phil Ide

*******************************************
*   Xbase++ FAQ, Libraries and Sources:   *
*   goto: http://www.idep.org.uk/xbase    *
* --------------------------------------- *
* www.xodc.org.uk - openSource Dev-Center *
*******************************************

Of course I'm sane. The voices said so.
Re: focus on HTML page?
on Fri, 26 Aug 2005 12:25:45 +0200
Hi Phil,

Yes, couldn't be easier.  Thanks.

The following problem i have is how to control the ENTER key in a html page.

I have three input fields, and i have three buttons.  SEEK - MENU - PREVIOUS

If the user enters data in one of the the input fields and presses OK, i
want the seek button be executed.  If he presses the TAB key, he skips to
the next input field.

I hope as easy for you as the previous question?

Bye,

Chris Andries.




"Phil Ide" <phil@xodc.org.uk> wrote in message
news:18ubnrdnmx2yv.dlg@xodc.org.uk...
> Chris,
>
> > I'm creating a HTML page with Xbasee++ which contains 3 buttons and an
input
> > field.  Everything is working correct.  One thing that I can't complish
is
> > the focus.
> >
> > When the page is shown in the browser, it would be easy for the user if
the
> > focus is already in the input field.  So she/he can enter the data
> > immediately, without clicking in the field first.
> >
> > Anyone who knows if this is possible?
>
> Easy as pie.
>
> <form name="myform" ...>
>   <input type="text" name="input1">
> </form>
>
> <script>
> document.myform.input1.focus()
> </script>
>
>
> Regards,
> --
> Phil Ide
>
> *******************************************
> *   Xbase++ FAQ, Libraries and Sources:   *
> *   goto: http://www.idep.org.uk/xbase    *
> * --------------------------------------- *
> * www.xodc.org.uk - openSource Dev-Center *
> *******************************************
>
> Of course I'm sane. The voices said so.
Thomas Braun Re: focus on HTML page?
on Fri, 26 Aug 2005 14:24:16 +0200
chris@aboservice.com wrote:

> The following problem i have is how to control the ENTER key in a html page.
> 
> I have three input fields, and i have three buttons.  SEEK - MENU - PREVIOUS

per default, ENTER only works with a single submit button.

Everything elsa has to be done with jscript... one of the eventhandlers
onKeydown, onKeyPress, onKeyup should be the right one to accomplish what
you want.

Thomas Braun
Re: focus on HTML page?
on Fri, 26 Aug 2005 17:11:49 +0200
Hello Thomas,

The sample has two buttons and is working as i prefer.  I just don't know
why the first button is 'pre-selected'.  I thought it was because of the
OK-label, but it isn't.

Bye,

Chris.

"Thomas Braun" <nospam@software-braun.de> wrote in message
news:vyyskvjs9zq.1m7rhw65vgrmf$.dlg@40tude.net...
> chris@aboservice.com wrote:
>
> > The following problem i have is how to control the ENTER key in a html
page.
> >
> > I have three input fields, and i have three buttons.  SEEK - MENU -
PREVIOUS
>
> per default, ENTER only works with a single submit button.
>
> Everything elsa has to be done with jscript... one of the eventhandlers
> onKeydown, onKeyPress, onKeyup should be the right one to accomplish what
> you want.
>
> Thomas Braun




start.htm
Thomas Braun
Re: focus on HTML page?
on Fri, 26 Aug 2005 23:46:32 +0200
On Fri, 26 Aug 2005 17:11:49 +0200, <chris@aboservice.com> wrote:

> Hello Thomas,
>
> The sample has two buttons and is working as i prefer.

Does it? I was always thinking that ENTER is not working with two
buttons... so I'm wrong 

Thomas

Xbase++ FAQ : www.software-braun.de/xbasecentral/xbfaq/
PURPOSE OF YOUR CAREER
Astronaut:  Advancing scientific knowledge for the good of humanity.
Fireman:    Saving lives and property.
Sysadmin:   Assuring uninterrupted access to alt.binaries.erotica.sheep.
		-- The Usenet oracle
Re: focus on HTML page?
on Mon, 29 Aug 2005 09:13:56 +0200
Hi Thomas,

With the 'onchange' i can put focus to the button i want.  Problem solved.

Bye,

Chris Andries.



"Thomas Braun" <spam@software-braun.de> wrote in message
news:WOWyPeoqFHA.6152@S15147418...
> On Fri, 26 Aug 2005 17:11:49 +0200, <chris@aboservice.com> wrote:
>
> > Hello Thomas,
> >
> > The sample has two buttons and is working as i prefer.
>
> Does it? I was always thinking that ENTER is not working with two
> buttons... so I'm wrong 
>
> Thomas
> --
> Xbase++ FAQ : www.software-braun.de/xbasecentral/xbfaq/
> PURPOSE OF YOUR CAREER
> Astronaut:  Advancing scientific knowledge for the good of humanity.
> Fireman:    Saving lives and property.
> Sysadmin:   Assuring uninterrupted access to alt.binaries.erotica.sheep.
> -- The Usenet oracle