Newbie question

C

Chris

This is a function which is to validate an uncertain number of
customers each time. How do i make the first example work :

this doesent work :

verify('document.form.output' + customerno
,document.getElementById('e-mail'+ customerno).value );

but this does :
verify('document.form.output' ,document.getElementById('e-mail'
).value );


Chris
 
K

kaeli

cris_smith_ said:
This is a function which is to validate an uncertain number of
customers each time. How do i make the first example work :

this doesent work :

verify('document.form.output' + customerno
,document.getElementById('e-mail'+ customerno).value );

No, no.

verify(document.form.elements
["output"+customerno].value,document.form.elements["e-
mail"+customerno].value);

assuming: the function verify expects 2 strings as params, that both
form elements are indeed strings and not blank, that the form is named
"form" (bad practice BTW), that customerno has a defined value, and that
the elements "e-mail" and "output" exist on form "form".


-------------------------------------------------
~kaeli~
Press any key to continue or any other key to quit.
Who is General Failure and why is he reading
my hard disk?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
 
C

Chris

No, no.
verify(document.form.elements
["output"+customerno].value,document.form.elements["e-
mail"+customerno].value);

assuming: the function verify expects 2 strings as params,
it expects (String, value)
that both form elements are indeed strings and not blank, that the
form is >named "form" (bad practice BTW), that customerno has a
defined value, and that
the elements "e-mail" and "output" exist on form "form".

Yes all true
it takes (String, value) and handles a empty value

All i need is to get this going :

verify('String' + uniqueIndex ,document.getElementById['name' +
uniqueIndex].value);

But when i try this i get an error message saying uniqueIndex is
undefined
even though i have defined it
 
K

kaeli

cris_smith_ said:
All i need is to get this going :

verify('String' + uniqueIndex ,document.getElementById['name' +
uniqueIndex].value);

But when i try this i get an error message saying uniqueIndex is
undefined
even though i have defined it

Post your code. All of it in a full html doc so I can test it.
Either that or a link. :)


-------------------------------------------------
~kaeli~
Press any key to continue or any other key to quit.
Who is General Failure and why is he reading
my hard disk?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
 

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

No members online now.

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,218
Latest member
GracieDebo

Latest Threads

Top