Question

My validation message isn't working. how do you write this ? Create a javascript validateSummary() function...

My validation message isn't working. how do you write this ?

Create a javascript validateSummary() function that displays the message “You must include a summary of the trip in your report.” if the validation state of the summary field value is missing; otherwise set the custom validation message to an empty text string.

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

function validateSummary(){

   

    // custom validation message

    var message = "";

   

    // if the validation state of summary field is present

    if (typeof summary.validation !== 'undefined') {

        message = "";

    }

    else{

        message = "You must include a summary of the trip in your report.";

    }

}

Add a comment
Know the answer?
Add Answer to:
My validation message isn't working. how do you write this ? Create a javascript validateSummary() function...
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
  • 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 =...

  • This question relates to Javascript. Could you please show me why my code is not working?...

    This question relates to Javascript. Could you please show me why my code is not working? I want to create 2 text boxes and have the user enter something into both of them. If the text entered into both boxes is identical the a green message is made visible. If the boxes are different a red message is made visable. Please keep it simple because I am new to javascript. <html> <head>               <title></title>        <script>...

  • TASK: to receive this checkpoint, you must write a simple function that displays a text message...

    TASK: to receive this checkpoint, you must write a simple function that displays a text message on the screen. The function signature should be: void print_to_screen(char *message); This function should accept a string, and write each character of the string to the screen, and increase the current_screen_x variable for each character printed. You will need to maintain a pointer to the current line on the screen, as well as the position on that line. You could do this with definitions...

  • Hi everyone, For my Assignment I have to use C# in order to create a validation...

    Hi everyone, For my Assignment I have to use C# in order to create a validation form and include the following things to register and validate: Email Address, Username, Password, Retype Password, and a Submit Button. I have figured out some of the code for the Email Address validation: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Validation4 {     public partial class Form1 : Form     {        ...

  • need this in #c . You will now add server side validation code to the frmPersonnel...

    need this in #c . You will now add server side validation code to the frmPersonnel page. Currently, when the Submit button is pressed, the frmPersonnelVerified page is displayed. This is because the frmPersonnelVerified page is set as the Submit button's PostBackUrl property. Instead of having the page go directly to the frmPersonnelVerified page when the Submit button is pressed, we want to do some server side validation. If any of the validation rules fail, we will redisplay the frmPersonnel...

  • True/False 1. Browser-based validation can replace the need to write custom JavaScript code to validate user...

    True/False 1. Browser-based validation can replace the need to write custom JavaScript code to validate user input. 2. When you add a new property to an object that has been instantiated from a constructor function, the new property is available to all objects instantiated from the same constructor function. 3. Because objects in the browser object model are actually part of the web browser, you do not need to instantiate them in order to use them in your programs. 4....

  • Multiple Choice Which of the following is not a data validation technique? (a) The Round function...

    Multiple Choice Which of the following is not a data validation technique? (a) The Round function (b) Lookup fields (c) Default values (d) Input masks 6. When would you use the Date function (a) To display the current date (b) To display only the year from a date field (c) When doing math involving two date fields (d) To convert a value from a number into a date 2. Which of the following fields is least likely to be set...

  • Code needs to be written by KickC - Optimizing C-compiler for 6502 you must write a...

    Code needs to be written by KickC - Optimizing C-compiler for 6502 you must write a simple function that displays a text message on the screen. The function signature should be: void print_to_screen(char *message); This function should accept a string, and write each character of the string to the screen, and increase the current_screen_x variable for each character printed. You will need to maintain a pointer to the current line on the screen, as well as the position on that...

  • 1.) Write a recursive function named isPalindrome that will take a single string as an argument...

    1.) Write a recursive function named isPalindrome that will take a single string as an argument and determine if the argument is a palindrome. The function must return True if the argument is a palindrome, False otherwise. Recall that any string is a palindrome if its first and last characters are the same and the rest of it is also a palindrome (therefore, a single character is a palindrome): 2.) Consider a text file named samplestrings.txt that contains a collection...

  • using the website repl.it (must be done in Javascript) PGM #1 Write a Java program that can perform the Caesar cipher fo...

    using the website repl.it (must be done in Javascript) PGM #1 Write a Java program that can perform the Caesar cipher for English messages that include both upper and lowercase alphabetic characters. The Caesar cipher replaces each plaintext letter with a different one, by a fixed number of places down the alphabet. The cipher illustrated here uses a left shift of three, so that (for example) each occurrence of E in the plaintext becomes B in the ciphertext. For example...

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