Question

Q1: Write down a HTML code that contains three textboxes with caption Name, Department and job....

Q1: Write down a HTML code that contains three textboxes with caption Name,
Department and job. Write down a jQuery function that will give an alert if any of the
text box’s value is empty while submitting the form.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

we need to jquery library

<html>
   <head>
       <script type="text/javascript" src="./lib/jquery-3.3.1.min.js"></script>
       <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
   </head>
   <body>
  
   <h1>form</h1>
   <form method="post">
   <input type="text" id="caption_name" placeholder="Caption Name"><br>
   <input type="text" id="department" placeholder="Department"><br>
   <input type="text" id="job" placeholder="Job"><br>
   <button name="submit" type= "button" id="button1">Click to submit</button>
   <script type="text/javascript">
  
  
   $('#button1').click(function(){
          var capt=$('#caption_name').val();
   var depart=$('#department').val();
   var job=$('#job').val();
           if(capt == '')
           {          
               alert('please enter correct caption name');
           }
           else if(depart == '')
           {
               alert('please enter correct department name');
           }
           else if(job == '')
           {
               alert('please enter correct job');
           }
   });
   </script>
   </form>
   </body>
</html>

If you have any queries ..please comment ...thank you..

Add a comment
Know the answer?
Add Answer to:
Q1: Write down a HTML code that contains three textboxes with caption Name, Department and job....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using form events functions to answer this question. Use the attached form html file which contains...

    Using form events functions to answer this question. Use the attached form html file which contains 2 html radio buttons. When the first choice is chosen, display the text ”First” under the first choice. When the second choice is chosen, display the text ”Second” under the second choice. Instead of using JavaScript complete this question using JQuery <!DOCTYPE html> <html> <head>     <title>midterm exam</title>     <link rel="stylesheet" href="css/q1.css" /> </head> <body>     <div id = "page">        <form>   ...

  • <!DOCTYPE html> <html> <body> <!-- replace the text below with your name!--> <!-- --> <!-- -->...

    <!DOCTYPE html> <html> <body> <!-- replace the text below with your name!--> <!-- --> <!-- --> <title> TYPE YOUR NAME HERE</title> <script> // // Write a program that asks the user to enter the amount that he or she has // budgeted for a month. Call a function that uses a loop that prompts the user // to enter each of his or her expenses for the month and keep a running total. // The loop finishes when the user...

  • Develop an HTML form that could be used to enter your book information (Books, Authors, and...

    Develop an HTML form that could be used to enter your book information (Books, Authors, and Publishers) start with the HTML/JavaScript template provided Expand upon it! What field information would you enter into a system? Have your form use more then just character text fields ... radio buttons, pick lists, and other elements make your form easier to use and you don't need to do lots of JavaScript checks. What fields would be mandatory ... which could be left blank?...

  • <!DOCTYPE html> <html> <body> <!-- replace the text below with your name!--> <!-- --> <!-- -->...

    <!DOCTYPE html> <html> <body> <!-- replace the text below with your name!--> <!-- --> <!-- --> <title> TYPE YOUR NAME HERE</title> <script> // // Write a program that prompts the user to enter a number within the range of // 1 through 10 and calls a function to display the roman numeral version of // that number. If the number is outside the range of 1 through 10, the program // should display an error message. // // The following...

  • NEED HELP with HTML with Javascript embedding for form validation project below. I have my code...

    NEED HELP with HTML with Javascript embedding for form validation project below. I have my code below but I'm stuck with validation. If anyone can fix it, I'd really appreciate. ****************************************************************************** CODE: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nice</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> var textFromTextArea; function getWords(){ var text =...

  • 1. C# Code (40) You have three textboxes. You have a table: Faculty (FID, Name, Office) Assuming you have Access DatasSourcel objeet, which linked to the Table Faculty. (1) Write the code for a...

    1. C# Code (40) You have three textboxes. You have a table: Faculty (FID, Name, Office) Assuming you have Access DatasSourcel objeet, which linked to the Table Faculty. (1) Write the code for a "Insert" button that will insert a record into the above table (2) Write the code for a "Delete" button. 1. C# Code (40) You have three textboxes. You have a table: Faculty (FID, Name, Office) Assuming you have Access DatasSourcel objeet, which linked to the Table...

  • 1. C# Code (40) You have three textboxes. You have a table: Faculty (FID, Name, Office) Assuming you have Access DatasSourcel objeet, which linked to the Table Faculty. (1) Write the code for a...

    1. C# Code (40) You have three textboxes. You have a table: Faculty (FID, Name, Office) Assuming you have Access DatasSourcel objeet, which linked to the Table Faculty. (1) Write the code for a "Insert" button that will insert a record into the above table (2) Write the code for a "Delete" button. 1. C# Code (40) You have three textboxes. You have a table: Faculty (FID, Name, Office) Assuming you have Access DatasSourcel objeet, which linked to the Table...

  • <html> <!--This is the form for an instructor to upload a file having the grade of...

    <html> <!--This is the form for an instructor to upload a file having the grade of students in a class--> <body> <h2>Upload Student Grade</h2> <form action="1.php" method="POST" enctype="multipart/form-data">    Instructor's First Name:<input type="text" name="first"><br><br>    Instructor's Last Name: <input type="text" name="last"><br><br>      Instructor's Department Name:<input type="text" name="department"><br><br>          Upload student grade: <input type="file" name="image" /><br><br> <input type="submit"/> </form>    </body> </html> //***************************************************Q1****************************************************************************      /*(((( Q1)))). (18 points) Add the code below that *   uploads the file containing the students'...

  • i'm having trouble with 1 and 3 using html, javascript and jquery 1) Change the "Search"...

    i'm having trouble with 1 and 3 using html, javascript and jquery 1) Change the "Search" link on the left to a button that when clicked, hide all the fields on the form and display the text "This is a search feature..." 3) When the user fills the form and clicks "Login", the values inputted should be displayed in the empty row (under Login) of the page. The display should be in the form: Student ID: <input value> Student Name:...

  • Exercise 2 Using javascript (visual studio code) (a) Write code that creates 5 item objects (records)...

    Exercise 2 Using javascript (visual studio code) (a) Write code that creates 5 item objects (records) (b) Place the five item objects into an array (c) Write a function that prints an array of your items it has one parameter an array of items (d) Write a function that counts items that match some attribute value. (e) Write a function that filters an array of items. It has three parameter an array of item, an attribute name and a value....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT