COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

Is it possible to set focus to a table cell?

• Email
• Follow

Hi!

I have a scrollable css table cell thing going on, and would like to
set the initial page focus to that cell in order that scrolling up and
down with the cursor keys (or mouse scroll wheel even) will scroll that
table cell rather than the html page.

The page in question is here: http://test.jonathanmortimer.co.uk/other/

Any help is much appreciated!  All I've managed to find so far is focus
on form fields, I don't even know if focus on table cells is possible
but I'd have thought it should be.

 0
Reply jonny_morrisuk (53) 6/12/2006 11:42:07 AM

See related articles to this posting

jonny_morrisuk@yahoo.co.uk wrote:

> Hi!
>
> I have a scrollable css table cell thing going on, and would like to
> set the initial page focus to that cell in order that scrolling up and
> down with the cursor keys (or mouse scroll wheel even) will scroll that
> table cell rather than the html page.
>
> The page in question is here: http://test.jonathanmortimer.co.uk/other/
>
> Any help is much appreciated!  All I've managed to find so far is focus
> on form fields, I don't even know if focus on table cells is possible
> but I'd have thought it should be.

Hi,

Just an idea (without looking into your code):
You can maybe use a good old anchortag in your table at the right spot, and
go to there?

<a name="comehere"></a>

Now for JS, on some event:
location.hash = "comehere";

Regards,
Erwin Moller
 0

> You can maybe use a good old anchortag in your table at the right spot, and
> go to there?
>
> <a name="comehere"></a>
>
> Now for JS, on some event:
> location.hash = "comehere";

Thankyou!  That certainly put me on the right track.  I'd got as far as
the anchor tag but when it comes to onload and all that stuff I didn't
have a clue (I really should get a pocket reference book on it, any
recommendations?  I really like the CSS Pocket Reference from O'Reilly
which I have for CSS stuff)

<script type="text/javascript">
</script>

and further down, in my css-scrollable table cell:

<h2><a name="top">The Money Pit</a></h2>

Hurray! :D

 0

Jonathan wrote:

>
>> You can maybe use a good old anchortag in your table at the right spot,
>> and go to there?
>>
>> <a name="comehere"></a>
>>
>> Now for JS, on some event:
>> location.hash = "comehere";
>
> Thankyou!

Glad to be of help. :-)

That certainly put me on the right track.  I'd got as far as
> the anchor tag but when it comes to onload and all that stuff I didn't
> have a clue (I really should get a pocket reference book on it, any
> recommendations?  I really like the CSS Pocket Reference from O'Reilly
> which I have for CSS stuff)

I would absolutely advise the fat book of O'Reilly, AKA the bible:
Javascript, The definite Guide 4th edition.

It is THE reference and also serves as a great learningbook.
Hence it's fatness. ;-)

>
>
>
>
> <script type="text/javascript">
>  </script>
>
>
> and further down, in my css-scrollable table cell:
>
> <h2><a name="top">The Money Pit</a></h2>
>
> Hurray! :D

Good job.
:-)

Regards,
Erwin Moller
 0

> I would absolutely advise the fat book of O'Reilly, AKA the bible:
> Javascript, The definite Guide 4th edition.

Hmm, I will look out for it but only if it's not too expensive :/

> > In the <head> section:
> >
> > <script type="text/javascript">
> >  window.onload=function() {location.hash = "top"}
> >  </script>
> >
> >
> > and further down, in my css-scrollable table cell:
> >
> > <h2><a name="top">The Money Pit</a></h2>

Ack!  Just discovered this doesn't work in Firefox (or Safari).  I
don't suppose you could suggest any tweaks I could try?  I'm pretty
much lost with all this javascript stuff without a book.

 0

> Ack!  Just discovered this doesn't work in Firefox (or Safari).  I
> don't suppose you could suggest any tweaks I could try?  I'm pretty
> much lost with all this javascript stuff without a book.

Correction: it *does* work in Firefox (1.5.0.2 on the Mac) but not
Safari, so I still need to sort this out - anyone know why it wouldn't
work in Safari?  Can someone try this in IE on Windows for me too? :D

 0

For pocket references, I use the Visibone pocket references at
www.visibone.com.  Their are free online charts on the site.

Erwin Moller wrote:
> Jonathan wrote:
>
> >
> >> You can maybe use a good old anchortag in your table at the right spot,
> >> and go to there?
> >>
> >> <a name="comehere"></a>
> >>
> >> Now for JS, on some event:
> >> location.hash = "comehere";
> >
> > Thankyou!
>
> Glad to be of help. :-)
>
>  That certainly put me on the right track.  I'd got as far as
> > the anchor tag but when it comes to onload and all that stuff I didn't
> > have a clue (I really should get a pocket reference book on it, any
> > recommendations?  I really like the CSS Pocket Reference from O'Reilly
> > which I have for CSS stuff)
>
> I would absolutely advise the fat book of O'Reilly, AKA the bible:
> Javascript, The definite Guide 4th edition.
>
> It is THE reference and also serves as a great learningbook.
> Hence it's fatness. ;-)
>
> >
> >
> >
> > In the <head> section:
> >
> > <script type="text/javascript">
> >  window.onload=function() {location.hash = "top"}
> >  </script>
> >
> >
> > and further down, in my css-scrollable table cell:
> >
> > <h2><a name="top">The Money Pit</a></h2>
> >
> > Hurray! :D
>
> Good job.
> :-)
>
> Regards,
> Erwin Moller

 0

JRS:  In article <448e7b9c$0$31640$e4fe514c@news.xs4all.nl>, dated Tue, 13 Jun 2006 10:47:24 remote, seen in news:comp.lang.javascript, Erwin Moller <since_humans_read_this_I_am_spammed_too_much@spamyourself.com> posted : > >I would absolutely advise the fat book of O'Reilly, AKA the bible: >Javascript, The definite Guide 4th edition. > >It is THE reference and also serves as a great learningbook. >Hence it's fatness. ;-) Is that a recommendation given in the knowledge that the 5th Edition was described as "soon" over a month ago? For searchers : it's "JavaScript: The Definitive Guide". <FAQENTRY> Sec 3.1 needs review. -- � John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 � <URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript <URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources. <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.  0 Reply Dr 6/14/2006 3:20:44 PM Dr John Stockton wrote: > JRS: In article <448e7b9c$0$31640$e4fe514c@news.xs4all.nl>, dated Tue,
> 13 Jun 2006 10:47:24 remote, seen in news:comp.lang.javascript, Erwin
> posted :
>>
>>I would absolutely advise the fat book of O'Reilly, AKA the bible:
>>Javascript, The definite Guide 4th edition.
>>
>>It is THE reference and also serves as a great learningbook.
>>Hence it's fatness. ;-)
>
>
> Is that a recommendation given in the knowledge that the 5th Edition was
> described as "soon" over a month ago?

Hi John,

No, my recommendations are always given without knowledge.
Knowledge is overrated. :P

But yes, I saw that 5th edition announced in this very group.

>
> For searchers : it's "JavaScript: The Definitive Guide".

Hmm, definitive? LOL.
I must have misread that title for ages then.
And also the former editions.
Anyway, thanks for correcting.

Regards,
Erwin Moller

>
> <FAQENTRY> Sec 3.1 needs review.
>

 0

8 Replies
390 Views

Similar Articles

12/12/2013 1:28:31 AM
page loaded in 314854 ms. (0)

Similar Artilces:

Table cell editors and focus?
I have a custom table cell editor. It seems that this editor never gets the focus when it is clicked on with the mouse, but it does get the focus when it is edited with the F2 key. Clicking on it with the mouse does generate a mousePressed() event that gets delivered to the editor, but there is no corresponding focusGained() event. Should the editor be getting the focus when clicked on? Should I try some stupid, infuriating hack to turn a mousePressed() event into a requestFocus() call? I'm on JDK 1.4.2 in case it matters. Cheers, Laird Hello! Laird Nelson <lairdnelson@com...

Is it possible to delete empty column and cell in SW2005 design table?
Greetings: I've made a simple station like (little desk) with a design table, the table width dimension will vary depending on the number of person, 1, 2, 3, etc. When I insert the design table into a drawing, it has extra empty columns and cells. Is there a way to delete these empty columns and cells? Advance thanks for your time and help. njchen24@yahoo.com.sg wrote: > > Greetings: > > I've made a simple station like (little desk) with a design table, the > table width dimension will vary depending on the number of person, 1, > 2, 3, etc. When I insert the ...

Is it possible to control the image quality by set the quantity table using IJG?
In generally, we use jpeg_set_quality() function to constructs JPEG quantization tables appropriate for the indicated quality setting. then how can i directly set the quantization tables directly ? If anyone happen to know ,pls send me some useful informations, include some sample code will be greatly appreciated. thanks in advance. Kingore@126.com control image quality by using quantity table in stead of jpeg_set_quality. After i read the relative code of IJG,it seems we can do some work in these functions: jpeg_set_linear_quality jpeg_add_quant_table jpeg_quality_scaling Has anyone a...

Setting focus after validating sets focus to next input field
Hello, I am doing some simple form validation and experiencing some obscure behavior I cannot seem to correct. A simple text field is validated to ensure that only numeric data is entered (using RE). Validation function is set to focus and select input field on failure. However, after validation of invalid entry, the focus is set on the subsequent input (the fee field in this example - code is below). The alert is fired prior to focus and select-just weird. Failing on IE6 and Firefox1.0.6. My JS functions: <code> <head> <script language="JavaScript"> <!-...

Why does putting focus on textbox also set focus to submit
Is there a reason why setting focus to a textbox input, also gives focus to a submit button on the page, to where if you click enter in the text box, the submit button will be clicked. jw56578@gmail.com wrote: > Is there a reason why setting focus to a textbox input, also gives > focus to a submit button on the page, to where if you click enter in > the text box, the submit button will be clicked. So that with simple forms, such as: Query: [ ] [Submit] A user can type and press enter, rather then having to type, tab and press enter or type the fiddle with the mouse. ...

How can I find the name of the parent table from a table cell?
I have something like this: <table name="test" id="test"> <tr> <td><input type="button" onClick="showMeParentTableName();"></td> </tr> </table> How can I have my input button show me the table of it's parent table? (eg. "test" in this case) All form elements, Inputs too, have a parent of Form, and form has other parents and such, instead, use a link in the TD, ..parentElement.parentElement.parentElement of a link on the TD will be the table, if you use an input, you'd have t...

I get a warning: This Create Table statement recursively references the target table. A consequence of this is a possible data integrity problem #2
PROC SQL; CREATE TABLE Factors As SELECT a.date, (b.RM-a.RF) as excess_mark, a.RF, b.RM, c.SMB, d.HML From temp.tbill as a, marketret as b, smbret as c, hmlret as d where a.date=MDY(b.month,1,b.year) & MDY(b.month,1,b.year)= MDY (c.month,1,c.year) & MDY(c.month,1,c.year)=MDY(d.month,1,d.year); quit; %macro bygroupexport(dsname,byvarname,charnum); data byvals; set &dsname; run; %if &charnum=character %then %do; data byvals; set byvals; length byvar2 \$ 32; byvar2=left(trim(&byvarname)); byvar2=tranwrd(TRIM(byvar2),' ','_1_'); byvar2=tranwrd(byvar2,'&am...

Setting Focus 15400
Currently in my html document I use the onload command inthe body section to set the focus to a certain field. eg onload="document.form1.SerialNo.focus()" Is there a way to set the focus to another field in a different frame other than the one that the current document is in? In my example, I have a frame called "top" that I would like the focus setting to whenever a certain document is loaded in the frame "main". My apologies if this is posted in the wrong newsgroup. TIA Darren. Darren Line wrote: > Currently in my html document I use the onload com...

How to set text in a cell
My web page has thumbnail pictures, and when the user clicks on a thumbnail, I change the image source of a full-size image elsewhere on the page. I'd also like to change the caption of the full-size image, but I'm not sure how to set the value of the text. I've tried creating a form with a single input field, and I can set the value of that field, but the field has a sunken style that I can't get rid of, and I'd like to find a different way of displaying the text. Is there an easier way to change the value of a text field? Thanks, Tom On Wed, 09 Mar 2005 14:31:04 -0...

Render Table Cell
I want to render the table cell by highlighting part of its area(amount may change) and display some strings as normal. To do that one i have created an UI class for the textbox and using that i have rendered the highlighting part using J2D. Then set that text box as a render component of the table cell. problem is i want to display the string in the textbox using '.settext' of the textbox. but it was not sucessed. If i used the J2d for the string too, i am not able to arrange the text inside the box. some times it exceeds the bountry. Pls give me a solution. ...

Is it possible to have an array in a table?
Can a table contain data arranged in two dimensions, and accessible through a pair of integer subscripts? I can live with 1-dimensional arrays, too. TIA, -RFH On Aug 22, 4:07=A0pm, Ramon F Herrera <ra...@conexus.net> wrote: > Can a table contain data arranged in two dimensions, and accessible > through a pair of integer subscripts? > > I can live with 1-dimensional arrays, too. > > TIA, > > -RFH Bonus question: I believe it is possible to save an arbitrary file (let's say an MS Word or PDF document) in Oracle. I'd appreciate the details on that. ...

Table default settings
hi all: I am tring to find where to modify the default table settings in Oracle. I have a tablespace with two tables associated with it. I want to change the default settings for my two tables in this tablespace without affecting the tables in other tablespaces. Where do I modify the default table settings in Oracle? Thanks in advace, FC FC wrote: > hi all: > I am tring to find where to modify the default table settings in > Oracle. I have a tablespace with two tables associated with it. I want > to change the default settings for my two tables in this tablespace > without ...

autonumbering table cells
I often have need to format text that looks like the following. 1. foo "definition" 4. barfoo "definition" 2. bar "definition" 5. foofoo "definition" 3. foobar "definition" 6. barbar "definition" where the numbers are one column, the words are a second column, and the "definition"s are a third column. It would be useful to number the items automatically, and for a single column list, this is easy: \begin{document} \newcounter{titem} \newcommand{\ti}{\refstepcounter{titem}\arabic{t...

Setting focus AND anchors
Hello All, I have a Perl script that creates my HTML, which has a form, and then I set focus to a specific part of the form with: ...my form and input fields here.... </form> <script language="JavaScript"> document.sendquickmsg.qmsg.focus(); </script> But just now I added an anchor in the link, so that my browser scrolls right to the edit field. So my script is called with the achor (http:.../myscript.pl?id=123#myanchor) What I have found is that my Javascript set focus call no longer works if I call the anchor. But still works if I don't. Does one ca...

Setting focus to window
I want to use a second window to link to and put new content in it and pop up is some link is clicked. How to set the focus to the second window if it's already open. With what I do now, the window stays below my main window. "Guus Ellenkamp" <ellenkamp.guus@wolmail.nl> writes: > I want to use a second window to link to and put new content in it and pop > up is some link is clicked. How to set the focus to the second window if > it's already open. With what I do now, the window stays below my main > window. I would use a function like function winOpen...

set focus on the button
Hello, This a question from a javascript n00b: I would like to display a confirmation box using confirm() method BUT is it possible to change the default focus on it from OK button to Cancel button? Or should I use something else? What then? Thanks Roman > Or should I use something else? What then? Restate confirmation message in a different way. E.g.: Instead of "Are you sure you want to quit?" ask "Do you really wish to stay?" :) marss wrote: > > Or should I use something else? What then? > > Restate confirmation message in a different way. > E....

setting focus 63052
Hi, I have the neccesity to place focus on a piece of text which is a cell inside a table. The reason why I need this is because whenever the page refreshes it always goes to the top of the screen and the user needs to scroll down to the where this information is. After the screen refreshes about 1 dozen times this can be quite annoying. I have tried a number of different things all involving focus() however with no luck. Any recomendations would be appreciated. Regards, Chris lasher168 said the following on 6/20/2006 5:44 AM: > Hi, > > I have the neccesity to place focus on a p...

Setting focus into FCKEditor
Hello everyone, I know this isn't related to generic javascript but I didn't found a group dedicated to the FCKEditor. I'm sorry for the inconvenience. I'm desperately trying to set the focus into a FCKEditor component (client side). I know that the FCK object exposes a "Focus()" method (the capital F isn't a spelling mistake). The problem is I don't know how to bind to this object from my container page (aspx). How can you reference this object? Thanks Fran=E7ois Nevermind, I found the right way to do it. The key is the FCKeditorAPI. Obviously, I haven&#...

Setting Focus to a position in a graphic
I have a image that has a number of mouseovers defined as areas within the graphic. The graphic is a large map which scrolls even on a full screen. Here is what I am trying to do. In a field when someone types a location, I would like to have the javascipt set focus to that location in the graphic. Like jump to a link, except that it is a jump to a x/y coord in a graphic. Thanks in advance for any assistance. TK knightowl wrote: > I have a image that has a number of mouseovers defined as areas within > the graphic. The graphic is a large map which scrolls even on a full > sc...