Question: JAVASCRIPT PROGRAMMING Imagine that Wake Tech has instituted a new class registration procedure. Students are required to enter into a text box their course information

JAVASCRIPT PROGRAMMING

Imagine that Wake Tech has instituted a new class registration procedure. Students are required to enter into a text box their course information in the following format: AAA.111#2222_aa-1234 (HINT: this entry should return as valid if your regular expression is correct) Example: WEB.110#4101_sp-2017

where AAA represents the capitalized department number (example: WEB or GRD) then a period

111 represents the course number (example: 110 or 115) then a hash tag

2222 represents the course section number (example: 4101 or 0002) then an underscore

aa represents the lowercase 2 character semester code (example: sp, su, fa) then a dash

1234 represents the school year (example: 2017) Your Web page will ask the user to type their information in a text box.

The user will then click a form button named validate. If the format is correct a message will be generated below the button that reads "Correct Format". If the format is incorrect a message will be generated that reads "Incorrect Format".

Important Your output must appear as text in your Web page. Do NOT use an alert() method for your output. HINT: use the innerHTML property to accomplish this. Your output must be generated by an external JavaScript (.js) file

The File must contain an external javascript from which the OUTPUT IS GENERATED. Please help! Thank you

This is what I tried to do in my javascript but it didnt work:

function isValidCourse (course_input){

var str = document.getElementById("courseInfo").value;

var checkerRegExp = new RegExp("[A-Z]{3}[.][0-9]{3}[#][0-9]{4}[_][a-z]{2}[-][0-9]{4}");

}

if (a == true) {

document.getElementById("result").innerHTML = "correct"

}

else (

document.getElementById("result").innerHTML = "incorrect"

)

MY HTML:

!DOCTYPE html>

Chapter 6 Assignment

PLEASE HELP

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!