![]() |
|
|
+ Search |
![]()
|
Aug 22nd, 2001 02:56
Simon Burnett, jacque leavitt,
To save HTML to a database field I used a DIV block to encapsulate the HTML. For example: <DIV name=divMyHTML> <TABLE><TR><TD>Hello There</TD></TR></TABLE> </DIV> I used a function called from the onsubmit attribute of my FORM. This function copied the DIV's InnerHTML property value into a hidden field which was submitted and inserted into the databsae field. I had issues referencing the DIV element sometimes - was a bit of a nightmare but if you are using one window and no frames you should be ok referencing it with <divname>.innerHTML remember to clean it up the SQL before inserting, making sure any apostrophes are replaced with two apostrophes so ASP can parse them ok. If its the ENTIRE page you need to save then try looking at the spidering technique that gets the HTML for a web page. Don't know it off hand but a quick search should reveal if for you. Hope it helps
© 1999-2004 Synop Pty Ltd