0

How are you,

I need to write the follwoing code in JavaScript. I
Thank you in advance.

<script language = "VBScript">
 Dim days(7)
 days(0) = "Sunday"
 days(1) = "Monday"
 days(2) = "Tuesday"
 days(3) = "Wednesday"
 days(4) = "Thursday"
 days(5) = "Friday"
 days(6) = "Saturday"
 Sub SetDay (day)
   Daybox.value = "You Selected " & days(day) &" for your delivery"
 End Sub
</script>
</head>
<body>
      <h2>Please select the delivery day of the week</h2>
  <br>
  <form name = "DayForm">

  <tr><td>
    <input type = "radio" name = "RadioDays" onClick =
      "SetDay(0)">Sunday
  </td></tr>
  <tr><td>
    <input type = "radio" name = "RadioDays" onClick =
      "SetDay(1)">Monday
  </td></tr>
  <tr><td>
    <input type = "radio" name = "RadioDays" onClick =
      "SetDay(2)">Tuesday
  </td></tr>
  <tr><td>
    <input type = "radio" name = "RadioDays" onClick =
      "SetDay(3)">Wednesday
  </td></tr>
  <tr><td>
    <input type = "radio" name = "RadioDays" onClick =
    "SetDay(4)">Thursday
  </td></tr>
  <tr><td>
    <input type = "radio" name = "RadioDays" onClick =
      "SetDay(5)">Friday
  </td></tr>
  <tr><td><input type = "radio" name = "RadioDays" onClick =
    "SetDay(6)">Saturday
  </td></tr>  </td></tr>
  </table>
</form>
<br>
<input type = "text" name = "Daybox" size = "50">
</center>
</body>
2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Alex_student
1
 var days(7);
 days(0) = "Sunday";
 ...
 function SetDay (day) {
   document.GetElementById("Daybox").value = "You Selected " + days(day) + " for your delivery";
 }

I think the rest is the same.

Edited by |-|x

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.