4 Replies - 12143 Views - Last Post: 14 November 2011 - 04:42 PM

#1 Saya_26  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 07-November 11

Html form, "submit" button doesn't work

Posted 14 November 2011 - 02:03 PM

Hello,

I'm creating a website(for the first time!) and I'm currently stuck at forms.. No matter what I try, the submit button doesn't show the html page that I've linked it with. Here's the code, please let me know if there is anything wrong...

<form name="input" action ="C:\Documents and Settings\PV\Desktop\MsgSent.html" method="get">
	<p class= codec style= "position: absolute; top: 512px; left: 200px; z-index: 2"> <strong> Name: </strong><br/><input name="name" type="text" size= 39 /> <br/> <br/></p>
	<p class= codec style= "position: absolute; top: 560px; left: 200px; z-index: 2"> <strong> E-mail: </strong><br/><input name="email" type="text" size= 39 /> <br/> <br/> </p>
	<p class= codec style= "position: absolute; top: 607px; left: 200px; z-index: 2"> <strong> Comments: </strong><br/><textarea name="comments" cols="30" rows="3"> </textarea> <br/> <br/>
	<input type="submit" value="Submit" style="position: absolute; top: 88px; font-family: Bell MT, Arial, Sans-serif; font-size: 13pt; background-color: #631502; color: white" />
	</form>




The class and styles are according to my website.. ^-^ It looks quite messy though, sorry for that.. Also, when I try to add a checkbox before the Submit button, the button disappears.

And I do have another question, for a Site Map, is it alright to use nested lists?.. I haven't gone so far as xml.. I've learned only html and css till now.. So any suggestions and thoughts would be appreciated. Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Html form, "submit" button doesn't work

#2 DimitriV  Icon User is offline

  • vexing conundrum
  • member icon

Reputation: 587
  • View blog
  • Posts: 2,746
  • Joined: 24-July 11

Re: Html form, "submit" button doesn't work

Posted 14 November 2011 - 02:43 PM

I'd have a look at the docs on it and maybe even w3schools (sorry guys!) for some info.\
http://www.w3schools.../html_forms.asp
Was This Post Helpful? 0
  • +
  • -

#3 Atli  Icon User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4240
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Html form, "submit" button doesn't work

Posted 14 November 2011 - 02:50 PM

Hey.

The problem there is the value of the form's action attribute. It's an invalid URL.

URLs always start with the protocol to be used, followed by a colon and two forward-slashes, followed by the location it points to. For instance:
http://example.com/file.html

This breaks down into the protocol, (http), followed by the ://, followed by the location (example.com/file.html).

In your form, you have the URL:
C:\Documents and Settings\PV\Desktop\MsgSent.html

Which breaks down into the protocol C, followed by the colon (with the two slashes missing), and finally the location: Documents and Settings\PV\Desktop\MsgSent.html.

First of all, the URL is malformed: the two slashes following the colon are missing. Even forgiving that, the browsers wouldn't know what to do with a "C" protocol. (At least not by default.)

To load a file of the local hard-drive, you need to use the file protocol.
That is:
file:///C:/Documents and Settings/PV/Desktop/MsgSent.html

Note two things:

  • The addition of the third forward-slash after the protocol. This is because, as per URL syntax rules, there should be a host name. Like: file://host/path/to/file, but since this is a local file, the host is simply empty: file:///path/to/file. (You could use localhost for the host name, but that's a bit redundant.)

  • The forward-slashes / are used in the path, rather than the backward-slashes \ Windows paths normally use. This is how directories are separated in URLs, regardless of platform. (Although most browsers will work even with the Windows style paths as well.)

Was This Post Helpful? 3
  • +
  • -

#4 DimitriV  Icon User is offline

  • vexing conundrum
  • member icon

Reputation: 587
  • View blog
  • Posts: 2,746
  • Joined: 24-July 11

Re: Html form, "submit" button doesn't work

Posted 14 November 2011 - 02:51 PM

View PostAtli, on 15 November 2011 - 07:50 AM, said:

Hey.

The problem there is the value of the form's action attribute. It's an invalid URL.

URLs always start with the protocol to be used, followed by a colon and two forward-slashes, followed by the location it points to. For instance:
http://example.com/file.html

This breaks down into the protocol, (http), followed by the ://, followed by the location (example.com/file.html).

In your form, you have the URL:
C:\Documents and Settings\PV\Desktop\MsgSent.html

Which breaks down into the protocol C, followed by the colon (with the two slashes missing), and finally the location: Documents and Settings\PV\Desktop\MsgSent.html.

First of all, the URL is malformed: the two slashes following the colon are missing. Even forgiving that, the browsers wouldn't know what to do with a "C" protocol. (At least not by default.)

To load a file of the local hard-drive, you need to use the file protocol.
That is:
file:///C:/Documents and Settings/PV/Desktop/MsgSent.html

Note two things:

  • The addition of the third forward-slash after the protocol. This is because, as per URL syntax rules, there should be a host name. Like: file://host/path/to/file, but since this is a local file, the host is simply empty: file:///path/to/file. (You could use localhost for the host name, but that's a bit redundant.)

  • The forward-slashes / are used in the path, rather than the backward-slashes \ Windows paths normally use. This is how directories are separated in URLs, regardless of platform. (Although most browsers will work even with the Windows style paths as well.)

Awesome Atli, cool.
Was This Post Helpful? 0
  • +
  • -

#5 Saya_26  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 07-November 11

Re: Html form, "submit" button doesn't work

Posted 14 November 2011 - 04:42 PM

View PostAtli, on 14 November 2011 - 02:50 PM, said:

Hey.

The problem there is the value of the form's action attribute. It's an invalid URL.

URLs always start with the protocol to be used, followed by a colon and two forward-slashes, followed by the location it points to. For instance:
http://example.com/file.html

This breaks down into the protocol, (http), followed by the ://, followed by the location (example.com/file.html).

In your form, you have the URL:
C:\Documents and Settings\PV\Desktop\MsgSent.html

Which breaks down into the protocol C, followed by the colon (with the two slashes missing), and finally the location: Documents and Settings\PV\Desktop\MsgSent.html.

First of all, the URL is malformed: the two slashes following the colon are missing. Even forgiving that, the browsers wouldn't know what to do with a "C" protocol. (At least not by default.)

To load a file of the local hard-drive, you need to use the file protocol.
That is:
file:///C:/Documents and Settings/PV/Desktop/MsgSent.html

Note two things:

  • The addition of the third forward-slash after the protocol. This is because, as per URL syntax rules, there should be a host name. Like: file://host/path/to/file, but since this is a local file, the host is simply empty: file:///path/to/file. (You could use localhost for the host name, but that's a bit redundant.)

  • The forward-slashes / are used in the path, rather than the backward-slashes \ Windows paths normally use. This is how directories are separated in URLs, regardless of platform. (Although most browsers will work even with the Windows style paths as well.)



Woah!.. Thanks so much for the explanation. I tried what you suggested and it works!.. so Thank you (again)! :)

View PostjimmyBo, on 14 November 2011 - 02:43 PM, said:

I'd have a look at the docs on it and maybe even w3schools (sorry guys!) for some info.\
http://www.w3schools.../html_forms.asp


I did try looking it up at w3schools.. not much success though.. Thanks anyway.. :smile2:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1