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 va... 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 from textbox

96%

114 rated

Answer

First, retrieve the name and surname entered by the user. Check if there is at least one space included in the input. If no space is found, display a dialog message stating that the name-surname field does not contain a space.

Step 2

Extract ID number

99%

104 rated

Answer

Next, extract the ID number from the input field. If the ID number field is empty, display a message indicating that the ID number must be entered. If the ID number entered does not consist of exactly 13 digits, show an appropriate error message indicating that the ID number does not contain 13 digits.

Step 3

Validate both fields

96%

101 rated

Answer

Before moving forward, ensure both the name-surname string contains a space and the ID number consists of 13 digits. If both validations pass, set the welcome message label to be visible.

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

;