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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show HTML code generated from a form?

Status
Not open for further replies.

humbleprogrammer

Programmer
Oct 30, 2002
315
US
Hi,

I have a form that takes a users input and creates an Ad page. It takes info such as background color, text size, color, font, images in add, border color, etc. I then have this form post to a page, which displays what the Ad will look like.

I also have a scrolling text box that I want to display the generated HTML code in. I have it coded so they can click the copy button, which will copy the content to their clipboard. What I am unsure about is what's the best way to display the HTML code in the text box? Do I have to request all the form values and response.write them with the proper HTML tags or is there an easier way?

Thanks!
 
Yes. If they are not inputting the tags themselves into these form inputs then you will have to write the HTML tags yourself. The tags have to come from somewhere in order to be displayed. Depending on your inputs, though, you should only have to write out strings with beginning tags, the form input, and end tags. So you could have a function that just outputs all the html tags with the appropriate form input data when you call it.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top