Photo AI

Button [Question 1_1] Write code to validate the information entered by the user as follows: - Name and surname The input must contain at least one space to be valid - NSC Information Technology - Question 1 - 2017 - Paper 1

Question icon

Question 1

Button-[Question-1_1]-Write-code-to-validate-the-information-entered-by-the-user-as-follows:----Name-and-surname--The-input-must-contain-at-least-one-space-to-be-valid-NSC Information Technology-Question 1-2017-Paper 1.png

Button [Question 1_1] Write code to validate the information entered by the user as follows: - Name and surname The input must contain at least one space to be val... show full transcript

Worked Solution & Example Answer:Button [Question 1_1] Write code to validate the information entered by the user as follows: - Name and surname The input must contain at least one space to be valid - NSC Information Technology - Question 1 - 2017 - Paper 1

Step 1

Extract Name and Surname

96%

114 rated

Answer

Retrieve the name and surname from the text box.

Check if there is at least one space in the input string. If there is no space, display a message: "The name-surname field does not contain a space."

Step 2

Extract ID Number

99%

104 rated

Answer

Retrieve the ID number from the text box.

Check if the ID number text box is empty. If it is, display a message: "ID number must be entered."

Next, check if the ID number consists of 13 digits. If it does not, display a message: "The ID number does not consist of 13 digits."

Step 3

Validate Both Fields

96%

101 rated

Answer

If both the name-surname and ID number fields pass validation, set the visible property of the welcome message label to "true".

Join the NSC students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;