Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can anyone help me with this problem in JavaScript? I use the Visual Studio. Thi

ID: 3894746 • Letter: C

Question

Can anyone help me with this problem in JavaScript? I use the Visual Studio.

This the example code:

<html>
<head>
<script type="text/javascript">
function show(showform, showtxt) {
alert("Entry from " + showform + ": " + showtxt);
}

function pop(showform, showtxt) {
content = "Entry from " + showform + ": " + showtxt;
popWindow = window.open("", "popWindow", "width=300,height=100");
popWindow.document.write(content);
popWindow.document.close();
}
</script>
</head>
<body>
Create an HTML document that contains two forms. One form consists of a text field, the other a text area. Name the forms and the input devices. Use JavaScript to print the names and values in the forms.<br><br>
<form name="Text Field Form">
Text Field Form:<br />
<input type="text" name="txtfld" size="30" /><br />
<input type="button" value="Alert">
<input type="button" value="PopUp">
</form>
<form name="Text Area Form">
Text Area Form:<br />
<textarea name="txtarea" rows="3" cols="10" /><br />
<input type="button" value="Alert">
<input type="button" value="PopUp">
</form>
</body>
</html>

This is the question:

Create a form that uses a text input box. Ask the user to type his or her name in uppercase letters. The submit button will be an image. Validate that the form is not empty and that the user typed his or her name in only uppercase letters. Send the form to a server program if it is valid.

Review the code, interact with the page, and then make the following changes:

a. Download a G-rated image to use as the submit button image. Save it and name it so the page displays it as expected.

b. Change the page instructions and validation so the name must be submitted in all lowercase.

Explanation / Answer

If you have any doubts, please give me commnent...

<html>

<head>

<script type="text/javascript">

function validate(value) {

if (value.match(/^[A-Z]*$/))

return true;

else

return false;

}

function show(showform, showtxt) {

if (validate(showtxt))

alert("Entry from " + showform + ": " + showtxt);

else

alert("Invalid text! Text contains lowercase characters");

}

function pop(showform, showtxt) {

if (validate(showtxt)) {

content = "Entry from " + showform + ": " + showtxt;

popWindow = window.open("", "popWindow", "width=300,height=100");

popWindow.document.write(content);

popWindow.document.close();

}

else

alert("Invalid text! Text contains lowercase characters");

}

</script>

</head>

<body>

Create an HTML document that contains two forms. One form consists of a text field, the other a text area. Name the forms

and the input devices. Use JavaScript to print the names and values in the forms.

<br>

<br>

<form name="Text Field Form">

Text Field Form:

<br />

<input type="text" name="txtfld" size="30" />

<br />

<input type="button" value="Alert">

<input type="button" value="PopUp">

</form>

<form name="Text Area Form">

Text Area Form:

<br />

<textarea name="txtarea" rows="3" cols="10"></textarea>

<br />

<input type="button" value="Alert">

<input type="button" value="PopUp">

</form>

</body>

</html>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote