form for web page

  philep 00:27 09 Sep 2003

i have a site under construction and i've create a form in dreamweaver. what i dont know much about is what to place and where in a) my form b)web space providers folder to make it all work!

is thsi a big deal - can anyone help?

  Talented Monkey 20:11 09 Sep 2003

I get the impression you are not sure about the correct usage for syntax etc. I do assume you are familiar with dreamweavers form creation Here is a brief (for me !lol) explanation followed by a link which will show all the examples. You will need to be looking at the code view for your form in dreamweaver to see what im talking about.

The form is started with <form> and of course ended with </form> you can put other code in-between this such as tables.

Within the <form > tag we give the instructions as what to do with this data. Normally you only need to specify how and where the data is sent to. This is method=?post? and action=?webpage?
Eg <form method=?post? action=?/process.php?> this will send the form data to the webpage process.php when submit button is pressed.

There are several types of input field to get information, text, radio and checkbox. Text fields are quiet simply the boxes you type in text, such as those you used when you logged into this site with.

Checkbox, a square box you click to toggle which shows as a tick.

Radio, these are the round buttons which have a special property where you can select
only one. See this sites opinion Poll for example

Textarea large square which you define to enter block of text, such as the reply message box at bottom of this page. You havge to have extra commands to specify the size.

Select, to produce a drop down menu.

Hidden a hidden field if you want to include information that the user cant see such as a ntoe to yourself about the page the data came from.

Select, to produce a drop down menu.

To create one of the above we use <input> tag eg. <input type=?text?>

However this is just part of the tag we need a variable name in which the data is stored, this can be more or less what you want with a few exceptions you will run into problems if you use variables already reserved by php or whatever script/language you are sending the form to. (dotn worry too much for now!)

So if you wanted someones first name .. <input type=?text? name=?first_name?>

For multiple selections with radio or select you simply create a separate <input> tag for each option but specify the same variable name in then name=?? part eg:

We will also need to add yet another part to our <input> tag, a value.

<input type=?radio? name=?fav_col? value=?green?>This is Green
<input type=?radio? name=?fav_col? value=?red?>This is REd
<input type=?radio? name=?fav_col? value=?blue?>This is Blue

This will produce 3 round checkboxes of which you can only select one.

To create in Dreamweaver, click the radio group option under forms in names put the variable name eg fav_col. Then use the +- button to create the number of options you want. Label heading creates the text that will be displayed next to the button, eg This I s Red and value will be value stored in the variable eg red

There?s one more type I haven?t mentioned yet. Submit. This creates the all important submit button, you can have the standard grey button that everyone is familiar with or create your own icon or use a small image if this is better.
The name doesn?t particular matter unless you having several forms, which are being processed, and where you are using something like php where you this to tell the difference for now submit will do.
Value is the text which appears on the button
<input type=?submit? name=?submit? value=?click to submit?>

Ok I wont go into anymore detail, but I hope this will give you a better idea.

Please click here for a good reference,

Now what processing did you have in mind for the data? Am I right in assuming that like most people you want the results emailed to you? If so this process CAN be a lot more complicated and frustrating than people think.

Before I go on a long winded explanation of how to do this, tell me first if this is your intention. Also please answer the following .

Does your host allow you to use PHP with the hosting package you have?
Do you have a CGI-BIN directory/folder in your web-space ?
Oh and who are you hosted with.

Let me know and I will tell you further what options should be avaible to you.

  philep 10:55 11 Sep 2003


actually the form is something that ive already created in dw. its really the connections thereafter that id like to learn about. the provider can cope with php and has 'cgi' folders whatever they may be. essentially, when people fill out form, i just need it to be fired off tomy email address

  Talented Monkey 17:05 11 Sep 2003

Great to hear you have PHP available to you, much simpler!

As I said before, a form has to be processed by some other programme or code be it in php, perl or whatever and sent to the mail server with all the correct info. HTML can not do this. therefore you set the <form action=? ?> to send the form data to it.

Most commonly used method is using lengthy and sometimes complicated scripts in perl which mostly can only run in the CGI-BIN directory. Most people fall foul of this because they are a pain in the backside to set up. All these scripts have to edited before they can be used. Most authors instructions are poor and vague. And that?s assuming the script is written for your server type Linux or Unix, One most common problems people have with these is that you have to tell it the full server paths which are something like /home/usr /blah//blah.blah/blah and most people don?t understand this. on top of everything else it soon becomes something they wish they never had to do. I remember these experiences myself well from when I was a forms virgin many years ago, and I have been programming all my life!

Well anyway you will be pleased this wont be a problem for you or anyone else who has PHP as it come with the command function Mail() which automatically knows the paths etc and automatically deals with it.. There are 4 parts needed for this function, the email address you are sending it too, the message, subject and From. This is very simple to set up I have created a (I hope) plain English and simple walkthrough to set this up, with examples already given. Yes you do have to edit this yourself but compared to the ?old? ways its nothing!

This file click here contains about 12 lines of code, so bear this in mind when you find yourself staring at 134 lines of text!!!!

You don?t really need to set anything up in your web space, just upload the new file and edited form file and it should all work that simple. Oh one slight problem that may occur your host may have disabled the mail facility for php, but this is not usual occurrence.

Ok one more thing.. this site click here is a little personal project I have just started, Forms are a frequent question most people ask about and I hope to have one of the better informative sites on the web.. I am even thinking about having a processing service too.
Anyway as they say WATCH THIS SPACE!!!!

Ok please post any more questions or comments , I would like you and others to read this and see if you can follow and understand the instructions properly.

Many thanks

  Talented Monkey 17:10 11 Sep 2003

some reason i got only tagged onto the link
here it is again click here

  Forum Editor 17:26 11 Sep 2003

a form handler that doesn't require the alteration of many variables in the script, plus the entry of the path to the sendmail program on the server.

As Talented Monkey rightly says, many people get hopelessly lost when trying to set up cgi form handlers, particularly when perl is also involved, so it's refreshing to see a nice simple PHP solution being offered.

  philep 17:33 11 Sep 2003

thank you so much tm
i shall read it once more and have a go. yes you're right. i would imagine that im not the only one that comes unstuck at this stage!

thanks again

  richard 18:42 18 Sep 2003

thanks to Talented Monkey for this. One question I have is when you want to use multiple pages. I occasionally have to run web-based questionnaires for clients and in the past, I have managed to get all the questions into one page but this looks untidy. Is there a way to allow forms to cross pages or, when I see these questionnaires, is each page an individual form that gets sent each time?

  Forum Editor 23:06 18 Sep 2003

there's an excellent script called Form Processor Pro.

If you do a lot of this kind of thing it's well worth the $50 that it will cost, and you can get it if you
click here

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Samsung Galaxy S9 review

ManvsMachine and other artists put Apple's iMac Pro to the test using powerful rendering tools

What to expect at Apple's 27 March education event

Comment filmer l’écran d’un iPhone ?