In my HTML page, I have used a select box. In it are various course options. I need to display the fee of the course in the text box according to the option selected by user.
Pls help me with my script:
Pls help me with my script:
Code:
<script language="VBScript">
Sub Fee()
dim a,b
b=document.subscribe.course.selectedindex
a=document.subscribe.course.options(b).value
If (a=blank) Then
MsgBox("Please select a course!")
End If
If (a=all) Then
subscribe.txtfee.value="Rs. 3000"
End If
If (a=platinum) Then
subscribe.txtfee.value="Rs. 2500"
End If
If (a=gold) Then
subscribe.txtfee.value="Rs. 2000"
End If
If (a=silver) Then
subscribe.txtfee.value="Rs. 1500"
End If
If (a=bronze) Then
subscribe.txtfee.value="Rs. 1000"
End If
If (a=contests) Then
subscribe.txtfee.value="Rs. 500"
End If
End Sub
</script>
.
.
.
<select name="course">
<option selected value="blank"> </option>
<option value="all">All-In-One</option>
<option value="platinum">Platinum Photography Course (2 Years)</option>
<option value="gold">Gold Photography Course (1 year)</option>
<option value="silver">Silver Photography Course (6 months)</option>
<option value="bronze">Bronze Crash Course (3 months)</option>
<option value="contests">Monthly Contests</option>
</select>
<input type="button" name="btnfee" value="Check Fee" OnClick="Fee()">
<input type="text" name="txtfee" size=40 maxlength=35>