View Full Version : HELP -Onclick handlers for form elements generated using Response.Write
sorcha
11-06-2000, 08:19 AM
I have an ASP which displays records from a database for update. As the user needs to view all the records at once, and an unknown quantity of records is returned, I use the Response.Write method to display the data in form elements (checkbox,textbox etc) using a sequential row number, to create unique element names. However when I try and use an onclick event handler on an element it does not recognise the elements value. Any ideas why?
Moving topic to Databasing. http://209.61.189.12/~webm/htmlforums/forumdisplay.cgi?action=topics&forum=Databasing&number=3&DaysPrune=10&LastLogin=
------------------
Ian
Web Development - BIG Resources Inc
Head Guide - 123Webmaster.com (http://www.123webmaster.com/)
ian@123webmaster.com
BIG Resources.com (http://www.bigresources.com)
ICQ: 25828668
rparmar
12-17-2003, 06:28 PM
I have logical solution that will work OK;
Create a BIG string that will contain all fields data with field delimiter set in between.
Use Array for this BIG string;
Also append Coli_Rowj format at end;
This will tell you which cell in table you are. irrespective if rows contain controls or not.
When update/Changing cells you update this big string as well; and append "W" to BIG string to know data changed in cell; otherwise leave "R" to BIG string;
Update data using BIG string;
You will need InStr and Split VBScript functins to
achieve this.
RAJ
scoutt
12-17-2003, 06:41 PM
you posted to a thread that nobody cares about. it is almost 4 years old.
I do believe her problem has already been fixed.
rparmar
12-18-2003, 01:14 PM
could tell me where it is fixed,
so i can look at solution,
THX very much.
scoutt
12-18-2003, 01:58 PM
well if you seen the date I believe she found a fix but hasn't reported back since then. your guess is as good as mine. if you have a question than jsut post one, don't excpect an answer on one that is no longer valid.
putts
01-08-2004, 01:02 PM
Originally posted by scoutt
you posted to a thread that nobody cares about. it is almost 4 years old.
I do believe her problem has already been fixed.
Well, obviously somebody (rparmar) cares about it.
I think the proper grammar would be "nobody ELSE cares about.":P
Back to the problem...
Sorcha was prolly doing something like this...
while not(recSet.eof)
Response.write "<input type='text' name='" & intRow & "FieldName' onclick='javascript: document.myForm.FieldName.value = ""newValue"";'>
intRow = intRow+1
recSet.moveNext
wend
She would have had to do a...
document.myForm." & intRow & "FieldName.value......
to get it to work.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.