Hi All.

I finally got a solution.

In the onload method I did not include a call to the focus method.
For all beginners out there in order to set the carret on a textbox do thefollowing

tbox.selectionStart = pos;
tbox.selectionEnd = pos;
tbox.focus();


Cheers.








> From: shane_gannon@hotmail.com
> To: support-firefox@lists.mozilla.org
> Subject: RE: setting cursor to start of textBox held in xul dialog
> Date: Wed, 30 Apr 2008 15:38:03 +0100
>
>
> resending as I forgot to add subject.
>
> > From: shane_gannon@hotmail.com
> > To: support-firefox@lists.mozilla.org
> > Subject:
> > Date: Wed, 30 Apr 2008 15:13:05 +0100
> >
> >
> > Hi.
> > I am developing an extension for firefox 15. and 2.0 (and I am new to Firefox development).
> >
> > I want to bring up a dialog containging a textbox displaying the selected text from the browser. This has not been a problem. I have done this through xul and javascript.
> >
> > My problem is that I want the curser to appear at the start of the textin the text field, and I do not want the text to be highlighted. This willallow users to start editing the text box adding text to the start text inthe field without the need to move to the start of the textbox.
> >
> > I have tried to change the carret by using xul onload to point to a javascript method that changes the carret in the textbox (this is also where Iset the textbox value). But this did not work.
> >
> > I also tried using an onfocused method to change the carret in the field but to no avail.
> >
> > I guess this is not working because I am trying to override the defaultfocus behaviour for the dialog and the textbox.
> >
> > Can some one please let me know how I should do this.
> >
> >
> >
> >
> >
> > __________________________________________________ _______________
> > Messenger likes to chat, one on one..or to everyone! Welcome to the Family Download the Windows Live Messenger now
> > http://get.live.com/messenger/overview/
> > _______________________________________________
> > support-firefox mailing list
> > support-firefox@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/support-firefox
> > To unsubscribe, send an email to support-firefox-request@lists.mozilla.org?subject=unsubscribe

>
> __________________________________________________ _______________
> Its time to join the family - Get the next generation of Free Windows Live Services now!
> http://get.live.com/
> _______________________________________________
> support-firefox mailing list
> support-firefox@lists.mozilla.org
> https://lists.mozilla.org/listinfo/support-firefox
> To unsubscribe, send an email to support-firefox-request@lists.mozilla.org?subject=unsubscribe


__________________________________________________ _______________
Love Hotmail? It just got better Drag and Drop capabilities, new Reading Panes making it easier to read your mail, enhanced security settings, 5GBof FREE storage? New Windows Live Hotmail. Get your free account here
http://get.live.com/mail/overview/