Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic form validation with Javascript? 16

Status
Not open for further replies.

gbaughma

IS-IT--Management
Staff member
Joined
Nov 21, 2003
Messages
4,773
Location
US
Here's the situation.

I have form web page that is dynamically built from ASP. In other words, the record number is included with the name of the form field, so I could have frm23depart and frm27depart, for example.

I want to do some validation on those fields, but what I need is something like:

function compare(fieldno){
var1=document.form1.frm<fieldno>depart.value;
....

See the issue? I need the javascript to be dynamically passed which FIELD it needs to use for it's calculations

I'm using onchange="compare(<%=fieldno%>)" ... to pass the field number to the javascript.

Any thoughts on this? It's holding up a project that I'm working on.....

I don't really want to dynamically generate multiple functions just for this (although that would be an option).

--Greg


Just my $0.02

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
I think it was LFI that gave me the second one. And I deserve it.

Christiaan Baes
Belgium

"Time for a new sig." - Me
 
damber said:
Hey Chrissie, since when did you get your other star ??

Wasn't me! Chrissie must've actually contributed to the original post! At this point, I think such an offense should lead to star-removal!

gbauhma said:
Well, the project is complete.

Who cares anymore? We've hijacked your thread, man. Send $20,000 in unmarked bills and no one gets hurt.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
LFI said:
$20,000 in unmarked bills

Woohoo....!! We could have a virtual TT party !


Though I'm telling you, Chrissie has an alter-ego he's used to give himself a star... with meny more stars to come... ;-)

p.s. (Dave,.. shhhhhh.. don't talk about star-removal, don't forget how we got ours.... ahem. [thumbsup])

A smile is worth a thousand kind words. So smile, it's easy! :-)
 
Oh yeah......

Shhhhhhhhh......

;-)


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Well done! Now if you could just convince the other 20-or-so Tek-Tippers who have the same sig-line...

And here I thought I was being so original... :S

Well, *I HAD IT FIRST!!!!* <LOL>

Who cares anymore? We've hijacked your thread, man. Send $20,000 in unmarked bills and no one gets hurt.

You know, I think I've had more fun in this thread than any others. Oh, will you take a cheque? ;)



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
gbaughma said:
...will you take a cheque?

Absolutely! From anyone I trust.

So... No.

Cash only please.

:-D

Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
You know, I think I've had more fun in this thread than any others.

My fault, sorry for that.

Christiaan Baes
Belgium

"Time for a new sig." - Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top