473,761 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help needed!

Hello,

I have form that uses javascript createElement to add additional input
fields to it. However, my validating script will not process new input
fields because it can only find the named input boxes already on the page.
Anyone has any thoughts on how to solve this, your advice is much
appreciated.

Thanks
Feb 17 '06 #1
4 1906

Stone Chen wrote:
Hello,

I have form that uses javascript createElement to add additional input
fields to it. However, my validating script will not process new input
fields because it can only find the named input boxes already on the page.
Anyone has any thoughts on how to solve this, your advice is much
appreciated.

Thanks


Drive your validation from a Array of data. As you add fields push into
this array the new fields.

Your validation engine should loop through all the array records to do
validations.

Suggested Fields in table:
Name - Field Name
Alias - Alias of field (for display purposes if name is abstract)
ControlType - What type of control you are validating
ValidationType - NoNull or Value or NullWarning
DataType - Type of data in field (for value validation)

Each field type can have more than one record: eg, Null and Value
validation (checks for null / blank and if not null / blank, verify the
content)

Good luck!

JsD

Feb 17 '06 #2
"Java script Dude" <de********@yah oo.ca> wrote in
news:11******** **************@ g14g2000cwa.goo glegroups.com:

Stone Chen wrote:
Hello,

I have form that uses javascript createElement to add additional
input fields to it. However, my validating script will not process
new input fields because it can only find the named input boxes
already on the page. Anyone has any thoughts on how to solve this,
your advice is much appreciated.

Thanks


Drive your validation from a Array of data. As you add fields push
into this array the new fields.

Your validation engine should loop through all the array records to do
validations.

Suggested Fields in table:
Name - Field Name
Alias - Alias of field (for display purposes if name is abstract)
ControlType - What type of control you are validating
ValidationType - NoNull or Value or NullWarning
DataType - Type of data in field (for value validation)

Each field type can have more than one record: eg, Null and Value
validation (checks for null / blank and if not null / blank, verify
the content)

Good luck!

JsD


Thanks. I'm using a onBlur() event to push the field name, which is
generated dynamically, directly into the validation script, but the
validation script still cannot find the field. Any thoughts?
Feb 20 '06 #3
Lee <RE************ **@cox.net> wrote in
news:dt******** *@drn.newsguy.c om:
Stone Chen said:

"Java script Dude" <de********@yah oo.ca> wrote in
news:11****** *************** *@g14g2000cwa.g ooglegroups.com :

Stone Chen wrote:
Hello,

I have form that uses javascript createElement to add additional
input fields to it. However, my validating script will not process
new input fields because it can only find the named input boxes
already on the page. Anyone has any thoughts on how to solve this,
your advice is much appreciated.

Thanks

Drive your validation from a Array of data. As you add fields push
into this array the new fields.

Your validation engine should loop through all the array records to
do validations.

Suggested Fields in table:
Name - Field Name
Alias - Alias of field (for display purposes if name is abstract)
ControlType - What type of control you are validating
ValidationType - NoNull or Value or NullWarning
DataType - Type of data in field (for value validation)

Each field type can have more than one record: eg, Null and Value
validation (checks for null / blank and if not null / blank, verify
the content)

Good luck!

JsD


Thanks. I'm using a onBlur() event to push the field name, which is
generated dynamically, directly into the validation script, but the
validation script still cannot find the field. Any thoughts?


If you're using onBlur, why are you using the field name? You should
be passing a direct reference to the field (eg,
onchange="valid ate(this)". Note that I used onchange rather than
onblur(), because onblur() is almost always a mistake.

You should also choose a subject line that doesn't make you appear
to be a complete idiot.


Already changed to onChange(this), but there's some other problems with
that too.

BTW, why are people online so testy. I didn't filled in the subject line
because I couldn't think of a way to shorten my question in a meaningful
way. That gets me being called a "complete idiot". Jeez, @$$hole.
Feb 23 '06 #4
flynnjandm
1 New Member
Hello,

I am having the same problem with dynamically created form elements.
I read somewhere that IE has a bug that does not add dynamically created fields as named properties in the form. Therefore, even though you may be able to see the field by doing a form.elements[i].value, it will not let you access the form element using document.form.f ield.value. Basically you need to loop through the form elements and find the match.

var items = formname.elemen ts;

for (i =0; i < items.length; i++){
if (items[i].name == 'enteryourfield namehere') {
//do your processing here
}
}

I'm trying to find a way around this. If you find one let me know.

Lee <REM0VElbspamtr ap@cox.net> wrote in
news:dtbden01bb n@drn.newsguy.c om:
[color=blue]
> Stone Chen said:[color=green]
>>
>>"Java script Dude" <despam2004@yah oo.ca> wrote in
>>news:11401523 65.632557.11566 0@g14g2000cwa.g ooglegroups.com :
>>[color=darkred]
>>>
>>> Stone Chen wrote:
>>>> Hello,
>>>>
>>>> I have form that uses javascript createElement to add additional
>>>> input fields to it. However, my validating script will not process
>>>> new input fields because it can only find the named input boxes
>>>> already on the page. Anyone has any thoughts on how to solve this,
>>>> your advice is much appreciated.
>>>>
>>>> Thanks
>>>
>>> Drive your validation from a Array of data. As you add fields push
>>> into this array the new fields.
>>>
>>> Your validation engine should loop through all the array records to
>>> do validations.
>>>
>>> Suggested Fields in table:
>>> Name - Field Name
>>> Alias - Alias of field (for display purposes if name is abstract)
>>> ControlType - What type of control you are validating
>>> ValidationType - NoNull or Value or NullWarning
>>> DataType - Type of data in field (for value validation)
>>>
>>> Each field type can have more than one record: eg, Null and Value
>>> validation (checks for null / blank and if not null / blank, verify
>>> the content)
>>>
>>> Good luck!
>>>
>>> JsD
>>>
>>>[/color]
>>
>>Thanks. I'm using a onBlur() event to push the field name, which is
>>generated dynamically, directly into the validation script, but the
>>validation script still cannot find the field. Any thoughts?[/color]
>
> If you're using onBlur, why are you using the field name? You should
> be passing a direct reference to the field (eg,
> onchange="valid ate(this)". Note that I used onchange rather than
> onblur(), because onblur() is almost always a mistake.
>
> You should also choose a subject line that doesn't make you appear
> to be a complete idiot.
>
>[/color]

Already changed to onChange(this), but there's some other problems with
that too.

BTW, why are people online so testy. I didn't filled in the subject line
because I couldn't think of a way to shorten my question in a meaningful
way. That gets me being called a "complete idiot". Jeez, @$$hole.
Mar 8 '06 #5

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

Similar topics

28
3306
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical make-believe challenge in order to avoid confusing the issue further. Suppose I was hosting a dinner and I wanted to invite exactly 12 guests from my neighborhood. I'm really picky about that... I have 12 chairs besides my own, and I want them all...
7
1895
by: ChadDiesel | last post by:
Hello everyone, I'm having a problem with Access that I need some help with. The short version is, I want to print a list of parts and part quantities that belong to a certain part group---One list per page. I created a report that groups the parts by part classification group with a force new page after each group. The report is based on a query of that week's orders. Some of these parts have drawings (usually 2 each stored in an...
7
1762
by: Tina | last post by:
I have an asp project that has 144 aspx/ascx pages, most with large code-behind files. Recently my dev box has been straining and taking long times to reneder the pages in the dev environment. After addding another Crystal report, vs.net will no longer build the project - it just goes away - no message no nothing. My other dev box will build it but won't run it in debug. I ran a vs.net repair but it still does the same thing. vs.net...
10
14856
by: Mae Lim | last post by:
Dear all, I'm new to C# WebServices. I compile the WebService project it return no errors "Build: 1 succeeded, 0 failed, 0 skipped". Basically I have 2 WebMethod, when I try to invoke the first method it is working fine. Then when I try to invoke the second method it return me an error, Just In-Time Debugging, with error message "An exception 'System.StackOverflowException' has occurred in WebServices"
2
2905
by: trihanhcie | last post by:
I m currently working on a Unix server with a fedora 3 as an os My current version of mysql is 3.23.58. I'd like to upgrade the version to 5.0.18. After downloading from MYSQL.COM the package on the site, I made : rpm -i MySQL-server-5.0.18-0.i386.rpm then i have errors that relate to many conflicts. I cannot figure out why -and- cannot upgrade. Please Help !
2
1987
by: Steve K | last post by:
I got a bit of a problem I like some help on. I'm designing an online training module for people that work in food processing plants. This is my target audience. These workers have little or no computer knowledge at all! And they also have outdated, old browsers, slow modems, old computers, etc. So I need to keep this as simple as possible and as browser compatible as possible. The client wants a navigation bar at the bottom of each...
3
2417
by: Kitana907 | last post by:
Hi- I'm attempting to write a module that uses and updates info from two tables and does the following: Opens the recordset of a table called "tblstoreinv" If the Needed Field in the tblstoreinv table is null and is less than the DCOH field from the tbldcinv then: The Shipped Field in the tblstoreinv table equals the Needed Field and the DCOH field from tbldcinv = DCOH - Shipped Else If Needed from tblstoreinv is > DCOH from tbldcinv,...
9
2099
by: smartbei | last post by:
Hello, I am a newbie with python, though I am having a lot of fun using it. Here is one of the excersizes I am trying to complete: the program is supposed to find the coin combination so that with 10 coins you can reach a certain amoung, taken as a parameter. Here is the current program: coins = (100,10,5,1,0.5) anslist = def bar(fin, hist = {100:0,10:0,5:0,1:0,0.5:0}): s = sum(x*hist for x in hist)
2
2903
by: rookiejavadude | last post by:
I'm have most of my java script done but can not figure out how to add a few buttons. I need to add a delete and add buttong to my existing java program. Not sure were to add it on how. Can anyone help? my script is below. thank you import java.awt.*; //import all java.awt import java.awt.event.*; //import all java.awt.event import java.util.*; //import all java.util import javax.swing.*; //import all javax.swing class Product...
32
2790
by: =?Utf-8?B?U2l2?= | last post by:
I have a form that I programmatically generate some check boxes and labels on. Later on when I want to draw the form with different data I want to clear the previously created items and then put some new ones on. In my code I am doing the following: For Each ctrl In tpMain.Controls If TypeOf (ctrl) Is CheckBox Then If ctrl.Name.StartsWith("chkS") Then ctrl.Visible = False
0
9554
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9925
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7358
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.