so here is your javascript source codes

you could save it in external file, then connect to your html page, actually in previous page ,already add connect.

here is the source codes for previous question.

//contact page

function validateForm()

{

               var name = document.getElementById(‘txtname’);

               var email = document.getElementById(‘txtemail’);

               var artist = document.getElementById(‘txtartist’);

               var album = document.getElementById(‘txtalbum’);

               var comments = document.getElementById(‘txtcomments’);

               //[[check if the user put any value

               if(name.value.length==0)

               {

                              alert(“Please tell me your name.”);

                              name.focus();

                              name.select();

                              return false;

               }

               if(email.value.length==0)

               {

                              alert(“Please tell me your email address.”);

                              email.focus();

                              email.select();

                              return false;

               }//]]end here for check if empty

               if(email.value.indexOf(‘@’)<0 || email.value.indexOf(‘.’)<0) //check email address must have @ and .

               {

                              alert(“Email address is invalid,Please enter a valid email address.”);

                              email.focus();

                              email.select();

                              return false;

               }

               if(artist.value.length==0)//check use if is empty

               {

                              alert(“Please tell the artist.”);

                              artist.focus();

                              artist.select();

                              return false;

               }

               if(album.value.length==0)//check use if is empty

               {

                              alert(“Please tell the album or songs.”);

                              album.focus();

                              album.select();

                              return false;

               }

               if(comments.value.length==0)//check use if is empty

               {

                              alert(“Please tell the album or songs.”);

                              comments.focus();

                              comments.select();

                              return false;

               }

               //use confirm comand arrow use change mind,let use go back write again

               var doit = confirm(“your name is ” +name.value+”,\n your email is “+email.value+”,\n artist is “+album.value+”,\n comemnts is “+comments.value+” \n  If it is correct, please ok,if it is not then click cancel,go back fill the form again.”);

               if (doit)

               {

                              alert(“Thanks for fill out the form! You can continue now.”);

               }

               else

               {

                              alert(“Plese enter the information again”);

               }

              

}

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s