Jump to content

<form>


alternative

Recommended Posts

Hello,If we have a form and a submit button, e.g<form ...>..<input id="form1" type="submit" name="form1" value="Clear" />..</form>when the user presses the submit button what exactly happens? I mean, does the designer specify somewhere with codehow the submission is done? What code is executed?thanks

Link to comment
Share on other sites

The form data is submitted to the URL specified in the action attribute of the form tag. (An empty action attribute means the form will be submitted to to the URL of the document that contains the form.)Magic does not happen.The URL to which the form is submitted is usually an application written in a programming language like PHP. The application decides what, if anything, to do with the data, and what sort of output to generate.A few scripts for general purpose tasks like sending email are <almost> ready out of the box (they need a little configuring) but most scripts are tailored to the specific task.

Link to comment
Share on other sites

The form data is submitted to the URL specified in the action attribute of the form tag. (An empty action attribute means the form will be submitted to to the URL of the document that contains the form.)Magic does not happen.The URL to which the form is submitted is usually an application written in a programming language like PHP. The application decides what, if anything, to do with the data, and what sort of output to generate.A few scripts for general purpose tasks like sending email are <almost> ready out of the box (they need a little configuring) but most scripts are tailored to the specific task.
So if the action points to the URL of the document that contains the form, then does this mean that the code of how the form will be processed lies somewhere in that page's code? I mean, if I click view source of that page I will be able to see how the form is processed?
Link to comment
Share on other sites

does this mean that the code of how the form will be processed lies somewhere in that page's code?
Yes. This is very typical for login pages, for example. If the login fails, the login page is simply printed again. If the login succeeds, the user is redirected to a content document.
I mean, if I click view source of that page I will be able to see how the form is processed?
Not using any language I know. Server-side environments execute the code (say, PHP), but the code itself is not output. Text will be output (1) if HTML exists outside the code sections or (2) the code explicitly executes a print or echo statement.
Link to comment
Share on other sites

Yes. This is very typical for login pages, for example. If the login fails, the login page is simply printed again. If the login succeeds, the user is redirected to a content document.Not using any language I know. Server-side environments execute the code (say, PHP), but the code itself is not output. Text will be output (1) if HTML exists outside the code sections or (2) the code explicitly executes a print or echo statement.
One more question related to forms, I have a script that on the onclick event of the submit button executes the following:{event.preventDefault();// i make some changes to form fieldsdocument.forms["form's id"].submit()}it doesnt submit the form and I dont get any error. Without the script everything works fine.Do you have any idea why? I am using firefox, the latest version
Link to comment
Share on other sites

  • 2 weeks later...

Submit Button is used to submit the data to the server.Here isan example:<form name="input" action="html-form-submit.asp"method="get">Username<input type="text" name="Username">Password<input type="password" name="Password"><br/><input type="submit" value="submit"></form>When the user enters data in the text fields and clicks on the submit buttonthen the all the information is sent to the web server.Then the server decides what task is going to be performed on the data.Note:When you enter the data and click on the submit button then the data is sent to the page "html-form-submit-button.aspknow more about HTML submit buttonHTML form tag;-)

Link to comment
Share on other sites

Dude, you are responding to dead threads. Look at the dates!And please stop posting links to programmingbulls. For one thing, no one wants to create an account just to see if the information there is useful. For another thing, the policy of this board is to post links to W3Schools whenever possible, since the board is paid for by W3Schools.

Link to comment
Share on other sites

To 'Deirdre's Dad' hey let me tell you dat i gave the person information he needed.n the 2nd thng is dat i juz gave the link to the page where he could know more about HTML submit buttoni dnt wnt him to create an accnt.

Link to comment
Share on other sites

To 'Deirdre's Dad' hey let me tell you dat i gave the person information he needed.n the 2nd thng is dat i juz gave the link to the page where he could know more about HTML submit buttoni dnt wnt him to create an accnt.
well, for anyone who goes to that link you just posted (like me just now), they get a access denied/user login message. If you click around, then you can get to the tutorials, but as you're on a board paid for by W3schools, why not use their tutorials first?
Link to comment
Share on other sites

and if you want i can give links to W3schools in my site.In that way both of us wud get benefited.W3 has tutorials for every aspect of web designing so i wud lyk the traffic on my site to actually check out W3 if they dontget what they want.!!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...