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

The following code is what I have in my assignment. I need to make the cursor au

ID: 3531631 • Letter: T

Question

The following code is what I have in my assignment. I need to make the cursor automatically be in the UserName field on load. I don't know where to put that code or what code to use. I also am having trouble getting the uppercase code to work. Please help me figure out what I'm doing wrong.

here's the code:

<form id="form1" name="form1" method="post" action="" >
<span id="sprytextfield1">

<label for="UserName">User Name</label>
<input type="text" name="UserName" id="UserName" />
<span class="textfieldRequiredMsg">A value is required.</span></span>
</form>
<script>
var str= document.form1.UserName.UserName;
document.write(str.toUpperCase());
</script>

Explanation / Answer

<form id="form1" name="form1" method="post" action="" >
<span id="sprytextfield1">

<label for="UserName">User Name</label>
<input type="text" name="UserName" id="UserName" />

<script>document.getElementById('UserName').focus()</script>

<span class="textfieldRequiredMsg">A value is required.</span></span>
</form>
<script>
var str= document.form1.UserName.UserName;
document.write(str.toUpperCase());
</script>

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