Forum Moderators: open
I have a two part question I'd like some help with.
I'm trying to design a form where users can submit their 120 x 60 pixel banners to a database table complete with a link back to their web site. But I want them to be able to do it with as little error as possible.
Right now I have a form set up where a user copies and pastes the below code into a text area then modify the code from there as below then submit it:
<!--Begin Learn More Banner code-->
<A HREF="http://INSERT YOUR WEB ADDRESS HERE" target="_blank"><img src="Assets/Banners/INSERT YOUR BANNER IMAGE FILE NAME HERE" alt="INSERT NAME OF WEB SITE HERE" width="120" height="60" hspace="3" vspace="3" border="0"></A><br />
<!--End Learn More Banner code-->
In order to prevent typo's in the code from cutting and pasting and inserting information I want the user to just have to enter information ie; url address, alt information and image file name into a form but the whole piece of code above get's entered into the database.
Also once the user hit's the submit button, I want the information to not only get inserted into the database field but also have the form data passed to an email using AspMail.
Is this possible? I'm using Asp VB script Access Database and Dreamweaver MX as a development tool.
Thanks
Gerry
one way:
in the form, with an onsubmit() action, you can
slice and dice the individual parts in javascript
then you can either push it all back to the server
and return the completed code for cut and paste by
the user, or use onexit() in each field to as the
parsing trigger so that the user can copy the resulting
banner code before submitting.
+++++
Basically you are saying before they even fill in the form, I should direct them to a code generator script which will assemble the pieces of code that includes their information then have the completed code copied and pasted into the form field.
Since I'm new to all this can you direct me to a pre-packaged javascript that I could use?
Thanks
Gerry
you would then take those forms fields and attach them to your code like this:
dim strUserURL as string
dim strImageSrc as string
dim strAltInfo as string
dim strDBCode as string
strUserURL = request.form("URLField")
strImageSrc = request.form("ImageField")
strAltInfo = request.form("AltField")
strDBCode = "<!--Begin Learn More Banner code-->" & _
<A HREF="http://" & strUserURL & " target="_blank"><img src="Assets/Banners/" & strImageSrc & " alt=" & strAltInfo & " width="120" height="60" hspace="3" vspace="3" border="0"></A><br />" & _
<!--End Learn More Banner code-->"
then insert "strDBCode" into your database. the user never has to see your banner code, and you don't have to worry about them changing your info either.
-Matt
then insert "strDBCode" into your database. the user never has to see your banner code, and you don't have to worry about them changing your info either.
Matt,
Would "strDBCode" be the only field name in the database or do I need to modify my table information to include strUserURL strImageSrc and strAltInfo.
Sorry but I'm a bid new to all this.
Gerry