473,221 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

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 1863

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********@yahoo.ca> wrote in
news:11**********************@g14g2000cwa.googlegr oups.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.com:
Stone Chen said:

"Java script Dude" <de********@yahoo.ca> wrote in
news:11**********************@g14g2000cwa.google groups.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="validate(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
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.field.value. Basically you need to loop through the form elements and find the match.

var items = formname.elements;

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

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

Lee <REM0VElbspamtrap@cox.net> wrote in
news:dtbden01bbn@drn.newsguy.com:
[color=blue]
> Stone Chen said:[color=green]
>>
>>"Java script Dude" <despam2004@yahoo.ca> wrote in
>>news:1140152365.632557.115660@g14g2000cwa.google groups.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="validate(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
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...
7
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...
7
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. ...
10
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...
2
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...
2
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...
3
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...
9
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...
2
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...
32
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...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.