I need some help in coding a form, hope you guys can help. What I’m trying to do is have a form (which I have already made) and then after the user enters all the information and submits the form, it basically brings up another webpage w/ the information listed. I can’t seem to figure out how to make it submit to another html page, I know I may need a cgi script, but all the scripts I can find deal with mailto:, I don’t need it mailed to anyone I just need the information redisplayed on another page. Any html guru’s that can help, or point me in the right direction?
Who’s serving the page? The software they have installed makes all the difference, so you should probably ask them.
You could take a roundabout route and hide a 1pixel frame at the side of the screen. When the form submits, use Javascript to copy the information to the page in this frame (as well as the form doing whatever else it does with the info). When the new page loads read the information from the hidden frame into the new page with a javascript onload function.
This isn’t the best method, but it works regardless of your hoster’s setup. However, its clunky, and it relies on the visitor’s browser a) supporting frames and b) having Javascript turned on. The first isn’t usually a problem, the second can be.
You can’t do it with just HTML. If you use the HTTP GET method with your form, you’ll be able to extract the form data from the resulting request string using client-side scripting (e.g. JavaScript). So it’s technically possible, but using a server-side script (like a CGI program) is easier, better and more reliable.
Right now I don’t have a host, so I can’t say what platform they are on. See I work at internet tech support and when we have to escalate a ticket we have to fill out this lengthy template, it’s a pain. So I’m just trying to speed it up, just enter the info, tab, next bit of info, tab ect… Submit then, what I would like is for all the info to be redisplayed so just copy paste it in the ticket. I figured out how to code the html portion of the form, and sadly that’s were my knowledge ends, hehe. I have a feeling I’m going to have to learn javascript or cgi before I can get this working. I’ve been searching around for pre made scripts but no luck :.
Ok I get it now, the information must be parsed by either javascript or cgi, or another script. Well shoot, this will all be on a local machine, so I can’t really access a outside server to run a cgi and I don’t have the permissions or anything like that on my work computer, so I’ll have to go the javascript route mentioned by Forbidden and tirial (thanx!). I’ll guess I try learning it, if you happen to have some links to some good javascript tutorials, I would greatly appriciate it
While this whole world wide web approach is all very modern and information superhighway-ish, don’t you think it would be easier to make a template in an application like MS Excel or Word? It sounds like all you need to do is reformat some data in a certain way, and any office suite worth its salt will let you do that.
Yep.
Can you just write a C/C++/Pascal/whatever program and have the form reference it? CGI is nothing magical; it’s just a way for your program to print text so the browser knows it’s HTML-formatted data. If you can write software on the machine, you can write something to handle the form.
Perl or PHP would be the fastest and easiest solution for something like this; you might consider getting a copy (they’re free) and installing them on your server.
You could try something like this:
http://www.geocities.com/ironmike33/IT_Form.html
Using the same method (writing the HTML in javascript), you could get rid of the popup prompts and use a more traditional form like you were talking about…
There are loads of CGI form scripts available free on the Web. FormMail is one of the better known ones.
Snetho, thank you! That will work perfect, I’ll just modify it to what I need. I still should learn perl, cgi, asp, ect… Could be usefull. Thanx for the replys
If you’re going to play with web pages a lot, go with PHP first. It’s not hard to learn, and you can embed code right into your HTML files.
It might make sense to do it with PHP.
First, download something called PHPTriad:
It’s got everything you need to run Apache and PHP locally in Windows.
Then, all you have to do is write your html form and a PHP script to parse it.
See the following for a decent tutorial:
http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html
Essentially, you want your form to pass the info to your script
<form method="post" action="yourscript.php">
<input type="text" name="address">
<input type="text" name="birthdate">
<input type="text" name="shoesize">
and then have the script print each variable from the form
<?
echo "$address<br>";
echo "$birthdate<br>";
echo "$shoesize<br>";
?>
Then fire up Apache, then your web browser, and go to http://localhost/yourform.html. Enter the data, click submit, and voila.
I did something similar so patrons at the library where I work can type out resumes and print them from the web, since we don’t have word processors for the public:
http://scratchpad.xug.net/res.html
You could install Apache and PHP locally on every computer in your office, or just run one copy if you’ve got everything networked.
Hope that helps.