Newbie Form Question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a form for a guestbook.  I want to Append something what is entered
into the comments by adding "Location: " in bold to the beginnning of the
entry for when it is sent to the cgi script (which I can't access)

      <td><strong><font size="-1" face="Arial, Helvetica, sans-serif"
      <td><font size="-1" face="Arial, Helvetica, sans-serif" align="left">
                  <input name="2.Location" type="text" size="41">

For example, when it says hte following when signing the guestbook"
Location:   (form to enter one's location)
But only the form info (ie. location) that is entered  are being sent and
thus only the actual entry is sent
I want it so "Location:" then the entry from the form are being sent....

For example, if someone entered New York
Location: <<form to enter one's lcoation - New York in this case>>
only "New York" is sent
I want "Location: New York" to be sent.  I to add the word "Location: " to
the front as well

Any help is much appreciated...


Re: Newbie Form Question

Quoted text here. Click to load it

Bill. Basically you can't do it.

You need to be able to access the CGI script which is the best way to do
this. There are two dirty way round your problem I can think of.

1. <input name="2.Location" type="text" size="41" value="Location:">

This adds the string location to the input box, problem is it can be
removed, so, not much good

2. You could use the OnSubmit JavaScript function to add the word location
to the beginning of the text. I've not tried this and I'm unsure if it will
work but it's worth a try.

Here's some code you can play with ....

<script language="JavaScript">
function validate() {
<form name="guestbook" method="POST" action="script.cgi" onSubmit="return

Hope this helps you.


Site Timeline