Newbie to javascript

B

Betty

Hi All,

I'm new to JavaScript and im trying to improve a site that is
currently used within my workplace.

I have an asp site that has is made up with basic html page that hold
textareas and dropdown boxes.

My problem is i can tab down through the page fine, but when i try to
tab up this works fine for text boxes and text areas but on the
dropdown boxes instead of tabbing up this tabs down.

I know why but i don't know how to resolve the issue.

My main issue is that...
This page was originally set up by another developer years ago and it
was set up for users to use the tab key. Reason being, the users
couldn't afford to loose any data while out in the field so the tab
structure at the moment constantly sends the selected fields from the
drop own boxes to the database.

What i need to do is find a way for the system to work as it does at
the moment but for the users to be able to tab up and down to change
fields if need be.


This is a sample of one of the drop down boxes.
<tr class="tableheader">
<td width="160" height="20">
<h3>Boiler 5 'B' Feed Pump:</h3></td>
<td width="216" height="20">
<select size="1" name="feedpp5b"
onBlur=myOnChange(this.form,this.name) <%= txtDisabled %>>
<option><%= txtfeedpp5b%></option>
<option>I/C</option>
<option>O/C</option>
<option>S/BY</option>
<option>MTCE</option>
</select></td>
</tr>



Hope you can help.

Kind Regards

Betty
 
D

David Mark

Hi All,

I'm new to JavaScript and im trying to improve a site that is
currently used within my workplace.

I have an asp site that has is made up with basic html page that hold
textareas and dropdown boxes.

My problem is i can tab down through the page fine, but when i try to
tab up this works fine for text boxes and text areas but on the
dropdown boxes instead of tabbing up this tabs down.

Bad script.
I know why but i don't know how to resolve the issue.

My main issue is that...
This page was originally set up by another developer years ago and it
was set up for users to use the tab key.  Reason being, the users
couldn't afford to loose any data while out in the field so the tab
structure at the moment constantly sends the selected fields from the
drop own boxes to the database.

I think you mean it sends data each time a control loses focus.
Sounds overlay paranoid to me. Regardless, that alone won't affect
the behavior of the tab key.
What i need to do is find a way for the system to work as it does at
the moment but for the users to be able to tab up and down to change
fields if need be.

This is a sample of one of the drop down boxes.
<tr class="tableheader">
        <td width="160" height="20">
                        <h3>Boiler 5 'B' Feed Pump:</h3></td>
        <td width="216" height="20">
                <select size="1" name="feedpp5b"
onBlur=myOnChange(this.form,this.name) <%= txtDisabled %>>

This should really be:

onblur="myOnChange(this)"

The myOnChange function can then reference the name and/or form
property as needed.

But that is not the issue. The problem is in the myOnChange function,
which is unnecessarily focusing the next element in the form. Remove
the line that does that.
 
T

Thomas 'PointedEars' Lahn

Betty said:
[...]
My problem is i can tab down through the page fine, but when i try to
tab up this works fine for text boxes and text areas but on the
dropdown boxes instead of tabbing up this tabs down.

I know why but i don't know how to resolve the issue.

My main issue is that...
This page was originally set up by another developer years ago and it
was set up for users to use the tab key. Reason being, the users
couldn't afford to loose any data while out in the field so the tab
structure at the moment constantly sends the selected fields from the
drop own boxes to the database.

What i need to do is find a way for the system to work as it does at
the moment but for the users to be able to tab up and down to change
fields if need be.


This is a sample of one of the drop down boxes.
<tr class="tableheader">
<td width="160" height="20">
<h3>Boiler 5 'B' Feed Pump:</h3></td>
<td width="216" height="20">
<select size="1" name="feedpp5b"
onBlur=myOnChange(this.form,this.name) <%= txtDisabled %>>

Remove onBlur=... and the myOnChange() method, this can be better
facilitated in an accessible way with the `tabindex' attribute.
Also, your generated markup is not Valid: http://validator.w3.org/
<option><%= txtfeedpp5b%></option>
[...]

Don't post server-side code when you have a client-side problem.


PointedEars
 
D

Dr J R Stockton

In comp.lang.javascript message <e6bbce22-a5ed-4a36-9615-66b441925cc7@41
g2000hsy.googlegroups.com>, Fri, 4 Jan 2008 04:01:21, Betty <marie.barwi
(e-mail address removed)> posted:
I'm new to JavaScript and im trying to improve a site that is
currently used within my workplace.
This page was originally set up by another developer years ago and it
was set up for users to use the tab key. Reason being, the users
couldn't afford to loose any data while out in the field so the tab
structure at the moment constantly sends the selected fields from the
drop own boxes to the database.

If the data is important, a newbie should not be changing the code that
handles it. Choose a smarter employer.

Your apparent employer's Home Page, on load, gives an error in IE6, and
them makes an unnecessary noise when I am listening to something better.
In Opera 9, it wants an add-on, but thankfully is silent. Ctrl-Alt-V
reports 62 validation errors. Firefox error console shows 3 errors.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
 
B

Betty

Bad script.





I think you mean it sends data each time a control loses focus.
Sounds overlay paranoid to me.  Regardless, that alone won't affect
the behavior of the tab key.





This should really be:

onblur="myOnChange(this)"

The myOnChange function can then reference the name and/or form
property as needed.

But that is not the issue.  The problem is in the myOnChange function,
which is unnecessarily focusing the next element in the form.  Remove
the line that does that.


-----------------------------------------------------------------------

Hi David,

Thanks for the response.

I seemed to have confused you slightly with the Tabbing up part of my
query.

What I meant by that was actually tabbing back up through the dropdown
boxes was the use of Ctrl + Tab. This works fine within text boxes and
text areas but I cant seem to use Ctrl + Tab to tab back up through
the dropdown boxes.

The system is dependant on the current set up with the data being
transferred to the database straight away. This gets transferred to
the database as you tab out of that cell which is why the on blur - on
change was added to text boxes and dropdowns etc.

However I need to find a way to get round my tabbing problem.

Many thanks in advance
 
D

David Mark

-----------------------------------------------------------------------

Hi David,

Thanks for the response.

I seemed to have confused you slightly with the Tabbing up part of my
query.

What I meant by that was actually tabbing back up through the dropdown
boxes was the use of Ctrl + Tab. This works fine within text boxes and
text areas but I cant seem to use Ctrl + Tab to tab back up through
the dropdown boxes.

Do you mean Shift + Tab?
The system is dependant on the current set up with the data being
transferred to the database straight away.  This gets transferred to
the database as you tab out of that cell which is why the on blur - on
change was added to text boxes and dropdowns etc.

It is the script interfering. Look for a focus method call in
myOnChange.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top