Topic 1 Design the form 'Retrofit' the form data string above:
name=Evan+Burke&card=Visa&number=8443261344895544&order=French+perfume
For buying some French perfume into the HTML form fields and submit button on the Web page form.
The page can be display on the explorer like that.
Topic 2 Write the script
Script archives exist for PERL, Python and JavaScript. Search the Web for a script that processes the HTML forms data. Read the code and list the steps involved in processing the form.
Script archives exist for PERL, Python and JavaScript. Search the Web for a script that processes the HTML forms data. Read the code and list the steps involved in processing the form.
The related Script I found from the basic html tutorial website which validates the entries of the form. The condition of the validation is that all three fields cannot be null.
Begin function verify()
{
var message = "You are required to complete the following fields: ";
if (document.form.first.value=="")
{
message = message + " - First Name";
}
if (document.form.last.value=="")
{
message = message + " - Last Name";
}
if (document.form.email.value=="")
{
message = message + " - E-mail";
}
if (message == "You are required to complete the following fields: ")
{
document.form.submit();
}
else
{
alert(message); return false;
} }
So when the user click on the submit button the validation function of java script called in and checks each field specified in the function which basically check the field cannot be null. And if all fields are completed, the form is submitted. The java script for above code is been copied from http://javascriptsource.com website.
Topic 3 Can you modify the script to process the form?
Yes I can edit the script. The output after edit the script is as below.
Topic 4 Improve the user experience by add a Javascript feature.
No comments:
Post a Comment