473,549 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help ... form objects

Hi

Using IE6.

I have a textbox in a form. The form is called 'form1' and the textbox is
called 'textfield1'. I have an onBlur event on the textbox to check its
contents is an integer thus: <input type="text" name="textfield 1"
onBlur="checkIn teger(this);">

The function checkInteger(th is) is :

function checkInteger(pF ield)
{
var pattern=/^[0-9]*$/;
if(!(pattern.te st(pField.value )) & (pField.value!= ""))
{
alert(pField.na me + " must must be an integer");
}
}

I want the focus to go back to the field the error was thrown in. I have
tried all sorts of methods but the only one that seems to work is directly
refencing the textfield1 object like this:
document.form1. textfield1.focu s();

I would like to do something like:
var oField=pField;
document1.form1 .oField.focus() ;

I keep getting document.form1. oField has no properties. Whats wrong?

Many thanks for looking and any help.
Andy

Jul 23 '05 #1
3 2268
In article <6e************ *************** ***@unlimited.u ltrafeed.com>,
"Andy" <Please reply to the group> enlightened us with...

The function checkInteger(th is) is :

function checkInteger(pF ield)
{
var pattern=/^[0-9]*$/;
if(!(pattern.te st(pField.value )) & (pField.value!= ""))
{
alert(pField.na me + " must must be an integer");
}
}

I want the focus to go back to the field the error was thrown in.


pField.focus();

--
--
~kaeli~
You can't have everything. Where would you put it?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
> pField.focus();

Ahhhhhhh! The only one I didn't. Thanks indeed.
Andy.
Jul 23 '05 #3
Andy wrote:
Hi

Using IE6.

I have a textbox in a form. The form is called 'form1' and the textbox is
called 'textfield1'. I have an onBlur event on the textbox to check its
contents is an integer thus: <input type="text" name="textfield 1"
onBlur="checkIn teger(this);">

The function checkInteger(th is) is :

function checkInteger(pF ield)
{
var pattern=/^[0-9]*$/; if(!(pattern.te st(pField.value )) & (pField.value!= ""))
Doesn't make sense: Unbalanced brackets
& is not the same as &&

Mick

{
alert(pField.na me + " must must be an integer");
}
}

I want the focus to go back to the field the error was thrown in. I have
tried all sorts of methods but the only one that seems to work is directly
refencing the textfield1 object like this:
document.form1. textfield1.focu s();

I would like to do something like:
var oField=pField;
document1.form1 .oField.focus() ;

I keep getting document.form1. oField has no properties. Whats wrong?

Many thanks for looking and any help.
Andy

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1625
by: David Goodyear | last post by:
At the moment im experimenting with ideas in C++ and would really like to solve the following, please please help. Sorry i dont even know what the subject is this would come under? :( Sorry if this is elsewhere in the newsgroup & please reply with links to threads or something? (I dont know what to look for :( ) (Terms are prob. all wrong...
15
2105
by: tabonni | last post by:
I want to check each button groups and save the checked value into a 2 dimensional array. But, it doesn't work. Could anyone tell me what's wrong with my code. My code is as follow: <html> <body> <script language="javascript"> <!-- var temp = new Array(2) var status = new Array();
11
1899
by: milkyway | last post by:
Hello, I have an HTML page that I am trying to import 2 .js file (I created) into. These files are: row_functions.js and data_check_functions.js. Whenever I bring the contents of the files into this HTML file, all is OK but whenever the functions are separated (as it is now), when I run the page, I get the following error: Line 73,...
1
1547
by: Bogdan Zamfir | last post by:
Hi, I have big troubles with an Access2002 application I wrote it under Acc2002 Romanian, and try to run it on Acc2002 US version, and I have the following troubles For some forms, Load event is not executed, and when the form is opened (it is, but without triggering any LOAD event) I try to click on any button, It gets a message like...
0
2146
by: Diego F. | last post by:
I've been days with that. I'm trying to work with web services sending and returning objects, and the web service must store some objects. - My first try (the most obvious in my opinion) was to use a class contained in a extern dll so the web service and the application can use it and send or return via web services: public customObject...
8
10737
by: Edwinah63 | last post by:
Hi Everyone, in vb6 i was able to execute the following code and it would close the children is the reverse order they were opened eg the last child opened was the first child to close. in mdiparent i had this code i = Forms.Count - 1 Do Until i = 0
5
1179
by: Darious Snell | last post by:
I am using windows forms and vb.net. My problem is a little complex so please bear with me. I have written an application that references a .com based API linked to an external client application. The API exposes client user interface objects. One of the objects is similar to a grid. The first part of my application creates a reference...
4
2420
by: Tarun Mistry | last post by:
Hi all, I have posted this in both the c# and asp.net groups as it applies to both (apologies if it breaks some group rules). I am making a web app in asp.net using c#. This is the first fully OO application I will be making, also my first .NET application, so im looking for any help and guidance. Ok, my problems are todo with object and...
2
2191
by: garyusenet | last post by:
I could do with something similiar, can you tell me if you think this would work for me, and if there's any advantage in working with controls this way than how I currently am. At the moment i'm using the treenodes and each treenode needs a unique entry into my rich text box. After sitting at home with MSDN i've managed to get this...
10
1325
by: =?Utf-8?B?am9uaWdy?= | last post by:
New to VB.NET, designing my first form with an MS manual at my side, placing objects and writing code. For good reason I just: SAVED All (!!) deleted all objects leaving only a grey form, ran my program to see the result, then UNDO to get my objects back.
0
7532
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7971
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7491
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3509
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1068
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.