HTML Online Tutorial Contents

Following are the posts for HTML online Tutorial. To learn everything about HTML, just read these posts: HTML Online Tutorial HTML TAGS (2) HTML BASICS (3) HTML ELEMENTS (4) HTML ATTRIBUTES (5) More »

XHTML

XHTML stands for Extensible Hypertext Markup Language. It is also known as XML (Extensible Markup Language). It is a markup language. In XHTML, there are no predefined tags. The user defines the More »

HTML SUMMARY

In this tutorial, you learned: HTML Introduction HTML Tags HTML Basics HTML Elements HTML Attributes HTML Paragraphs HTML Headings HTML Formats HTML Image HTML Links HTML Lists HTML Frames HTML Table After More »

HTML TABLES (13)

HTML Tables are used to arrange data in web pages. HTML allows the use of tables by <table>…</table> tags. Each row in HTML table is recognized by <tr>…</tr> tag. In each row More »

HTML FRAMES (12.2)

Nested frames example: For the following example to work, there are two other simple HTML files : “HMTL11e1 frame a.html” and “HMTL11e1 frame b.html”. your browser will divide your screeub half. The More »

 

Tag Archives: asp forms with examples

9.2 asp

Learn about Basic ASP Forms and Inputs by User (9.2 ASP):

Just for revision:

Request.From:

It is a command which is used to get values in a form by using “post” method. The information which is sent by a form using get method is not available to everyone. This information also has no limits on its amount. The difference is that if the user would have typed “you” and “angel” in the HTML form then the URL sent to the asp server would be:

http://www.website-school.com/formex.asp

But if the file has asp scripts:

<body>

Hey

<%

Respone.write(request.form(“myname”))

Respone.write( “ “ &request.form(“mynames”))

%>

</body>

The internet browser will display:

Hey you angel

 

Following example shows how to use post method and Request.Form to interact with user:

Example of a Form by using Request.Form and “post” as a method:

<html>

<body>

<form action=”form_requeryzx.asp” method = “post”>

Name: <input type = “text” name = “myname” sixe = “12”/>

<input type = “submit” value = “submit”/>

</form>

<%

Dim myname

Frame=Request.Form(“myname”)

If myname<>””Then

Response.Write(“Hello” & myname & “/<br/>”)

Response.Write(“Whats up dude”)

End if

%>

</body>

</html>

Following example shows how to use radio buttons and Request.Form to interact with user:

Example of a Form by using Request.Form and radio buttons:

<script type=”text/javascript”><!–
google_ad_client = “ca-pub-7789281879799866”;
/* webpost */
google_ad_slot = “1930114734”;
google_ad_width = 300;
google_ad_height = 250;
//–>
</script>
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>

<html>

<%

Dim bikes

bikes=Request.Form (“bikes”)

%>

<body>

<form action=”form_radiobt.asp” method = “post”>

<p> Please select high quality bike:</p>

<input type = “radio” name = “car” />

<% if bikes = “Honda” then Response.Write(“checked”)%>

Value = “Honda”>Honda</input>

<br/>

<input type = “radio” name = “car” />

<% if bikes = “Yamaha” then Response.Write(“checked”)%>

Value = “Yamaha”>Yamaha</input>

<br/>

<input type = “submit” value = “submit”/>


</form>

<%

If bikes<>””Then

Response.Write(<p> Your high quality bike is: & bikes & “/<p>”)

End if

%>

</body>

</html>

The Form Validation:

It is compulsory for user input to be validated on the internet browser whenever it is possible. The Browser validation is easier, faster and decreases the load on the server.

If the user input is entered into the database then you should consider the matter of validation. The best way to validate a form is to post the form to itself rather than going to different page. In this way user will get the error message on the same page as the form. Thus finding the error will be much easier.

For more visit next posts in this category.To go back to Contents of this tutorial: ASP Active Server Side Scripting Contents

9.1asp

Learn about Basic ASP Forms and Inputs by User (9.1 ASP):

In HTML form we can use Request object to retrieve information from different forms. Following is the example of HTML form:

Example of HTML form:

<form method = “get” action = “formex.asp”>

Nameone: < input type = “text” name “myname”/>

<br/>

Nametwo: < input type = “text” name “mynames”/>

<br/>

<input type = “submit” value = “submit”/>

</form>

 

There are two commands which are used to retrieve user input from forms. These commands are:  Request.QuerryString and Request.Form

Request.QueryString:


The Request.QueryString is the command which is used for the retrieval of values in a form by using “get” method. The information which is sent by a form using get method is available to everyone. This information also has limits on its amount. The difference is that if the user would have typed “you” and “angel” in the HTML form then the URL sent to the asp server would be:

http://www.website-school.com/formex.asp?myname=you&mynames=angel

But if the formex.asp contains asp source code script:

<body>

Hey

<%

Respone.write(request.querystring(“myname”))

Respone.write( “ “ &request.querystring(“mynames”))

%>

</body>

As a result the output would be:

Hey you angel

Example of a Form by using Request.QueryString and “get” as a method:

<html>

<body>

<form action=”form_requeryz.asp” method = “get”>

Name: <input type = “text” name = “myname” sixe = “12”/>

<input type = “submit” value = “submit”/>

</form>

<%

Dim myname

Frame=Request.QueryString(“myname”)

If myname<>””Then

Response.Write(“Hello” & myname & “/<br/>”)

Response.Write(“Whats up dude”)

End if

%>

</body>

</html>

Request.From:

It is a command which is used to get values in a form by using “post” method. The information which is sent by a form using get method is not available to everyone. This information also has no limits on its amount. The difference is that if the user would have typed “you” and “angel” in the HTML form then the URL sent to the asp server would be:

http://www.website-school.com/formex.asp

But if the file has asp scripts:

<body>

Hey

<%

Respone.write(request.form(“myname”))

Respone.write( “ “ &request.form(“mynames”))

%>

</body>

The internet browser will display:

Hey you angel

 

For more visit next posts in this category.To go back to Contents of this tutorial: ASP Active Server Side Scripting Contents