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

How to create an HTML banner with a form with a dropdown menu

HTML: How To...

How to create an HTML banner with a form with a dropdown menu

by  tekagami  Posted    (Edited  )
If you want to create an HTML banner with a form with a dropdown menu just do the following:

1- Using your html editor create a a table with its graphics (absolute urls) and the form with the dropdown. Make the table with the dimensions of the the banner you want.

2- the html code for the table with the form must be all in one line and there must be NO "quotation" marks. The reason is the you are going to parse the banner as a Javascript.

3- Then create a text file and add your line of code to it. However oyu must add at the beggining of the line the following code: document.write("

and at the end: ")

It will look like this:
Code:
document.write("<table width=465 border=4 cellspacing=0 cellpadding=0 height=60 bordercolor=#FF0000 bgcolor=#0000FF><tr><td><table width=465 border=0 cellspacing=0 cellpadding=0><tr> <td><font color=#FFFFFF><b><font face=Arial, Helvetica, sans-serif>buy my products</font></b></font></td></tr><tr><td><form name=form1 method=post action=http://www.your-url.com/cgi-bin/whatever.cgi><select name=select><option value=option1 selected>option1</option><option value=option2>option2</option><option value=option3>option3</option></select><input type=submit name=Submit value=Submit></form></td></tr></table></td></tr></table> ")
4- save the file as banner.js (the important part is the .js extension)

5- Then wherever you want to to add the banner in the page just add:
Code:
<script    src="http://url.of.your.com/ad.js" type="text/javascript" language="Javascript">
</script>

NOTE- This technique is also very useful when you want to add HTML code to a page, like using SSI but instead of the server parsing the code you have the client parsing it and downloading it to the cache so it only is served once by the server
DONE :)
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top