Unable to submit form with POST - html

Here is the code to my site:
http://pastebin.com/jVk0aPW4
When I try to submit the page, it does nothing. This is the first time time I've tried to submit on this webserver. The network admin assures that POST and GET are explicitly enabled.
Is my HTML malformed? Or do I need to dig deeper on the server side?

You have a nested form, which will cause your form to explode (proper technical jargon).

Related

Does html structure make difference in get or post request?

I have a href , when i click on it, it goes with "POST"request.
(PS. i am using magento 1 framework)
<li>
Logout
</li>
when i remove this "login-popup-in-footer my-account-text" it goes with GET request which is ideal.
I am not sure if HTML Or htaccess file makes difference in GET OR POST request.
Feel free to share thoughts.
Thankyou
Neither, at least not directly.
The HTML you have will trigger a GET request. It can't do anything else.
It will be some client-side JS that is searching the document for elements which are members of one or more of those classes and adding an event listener that prevents the default behaviour of the link and makes a POST request.
Your server configuration can't influence it either. While it could issue a redirect response there is no way for one of those to response to a GET request in a way that causes the browser to make a POST request (although the reverse is not true).

What does a form tag do behind the scene

If I want to send data back to the server from user input I know I need to use the form tag.
But why do I need the form tag, what does a form tag do behind the scenes?
I've only been in web development for less than a year, so please forgive me if my question is beginner question.
Edit: I know a form is used to denote a part of the page that is interactive and data between the from tags will be sent back to the server.
So, is the tag, just a tag, is there another piece of technology that takes the data from the page and returns the data to the server?
Edit 2: From comments and more specific web searches, I found out that the form tag is just that. A tag. It defines something on a page and does not do anything. All is okay now.
The form tag validates and with html 5 it means it doesn't call the server immediately. It can do a quick check before it attempts to post. E.g. does the email box look like an email address.
The advantage of this is it reduces costs as you're not unnecessarily calling the server. When the form thinks it looks good it will send the info to the back end.
Get and post messages are sent either getting information (reading) or it might be posting (writing).
I think that's what you're after.

How should i get an email when i submit the request form / submit form through html

i am working on a submit form in my html page. When i click submit button, i should get mail in my inbox.
So what all the procedures, i need to follow to get the output.
You need to use a server side language like PHP / ASP.NET etc. Then:
User submits form.
Retrieve the submitted information.
Send an email using the email functionality specific to the language you decide to use.
You haven't given much so this is only an outline of what you need to do to get going. You can use Google for the various areas you need to implement.
Instead of using any server, is there any plugins which can be useful
to get my output. – Bharadwaj
I think this might do the job for you http://www.emailmeform.com/
I've never used it, but it looks like a website that hosts the form for you and emails you the results. You'd just put the form html on your page and let them do the rest.
Hope that helps.

how to reset a dynamically/ajax-ly added/created form using jquery?

In my webpage a form is inserted via Ajax. I am using $("#my-ajax-returned-form")[0].reset();
to reset the form but it doesn't work for me. Firebug console shows TypeError: $("#my-ajax-returned-form")[0] is undefined. Any clue how to fix it? The actual flow is as following and its plain vanilla AJAX with jquery
Click on a icon sends an ajax call to server
The server sends a form which is inserted into webpage using $('#target-div').html(returnedFormHTML) which contains my form with id my-ajax-returned-form
User fills up form and clicks save, data is posted to server using $.post()
On success I fire another method which is trying to reset my-ajax-returned-form using $("#my-ajax-returned-form")[0].reset();
Now, it is obvious that form has to be some live in some sense but I am unable to figure it out :(
Here is the main webpage - http://pastebin.com/rtkr8RUC
Here is the #my-ajax-returned-form form - http://pastebin.com/jtjakgUt
I can not post the complete code on jsfiddle easily, bear with me for that
Update
I found the issue, there is a reset button in the form named reset, so obviously form.reset is not a function.
But the textarea is still not reset!
Fixed the textarea issue as well
The undefined clearly indicates that there's a problem finding the form. Are you sure the selector is correct, are you looking for it inside the correct iframe etc. Try logging the $("#my-ajax-returned-form") to see if it finds anything.
You could try $('#my-ajax-returned-form').eq(0).reset(), but since the selector is an id and so should be unique, this doesn't seem to make much sense.
On the other hand, is the reset() - function even defined?

How can I post data (form) to html page and hijacking the data in the middle?

the site addres: http://www.ynet.co.il/YediothPortal/Ext/TalkBack/CdaTalkBack/1,2497,L-3650194-0-68-544-0--,00.html
fill the form with rubbish.
Hit 'Send'
the form post the data to another HTML without any parsing of the data i've just added
How do they do it?
A likely option is that they are using a content management system where "html" on the URL doesn't actually mean it's a static html file.
This may be out of left field, but I've certainly used the occasional JS function to grab everything in the header and either parse it or pass it to another script using AJAX.
I'll sometimes use this method in a 404.html page to grab the headers of the previous page, parse them out to see where someone was trying to go and redirect them.
That is, as annakata said, one of the numerous options available.
Edit based on clarified question:
Numerous frameworks can be configured to intercept an html request - for instance asp.net can be set to handle any given extension and an HTTPModule could do anything with that. It's really up to web server configuration what it decides to do with any request.
also: you don't really want to be saying "hijack"