Jump to content

codes are not working, help me fix it

 

<html><body><center>
<formname=f>
MONTH:<select name=b>
<option value=Jan>January
<option value=Feb>February
<option value=Mar>March
<option value=Apr>April
<option value=May>May
<option value=Jun>June
<option value=Jul>July
<option value=Aug>August
<option value=Sep>September
<option value=Oct>October
<option value=Nov>November
<option value=Dec>December
<select><br><br>
 
DAY<input type=text name=c><p>
<input type=button onclick=a() value=check><p>
ZODIAC SIGN:<input type=text name=d>
</form>
 
<script language=javascript>
function a() {
var x=document.f.b.value
var y=document.f.c.value
 
if(x=="Mar" && y>=21 || x=="Apr" && y<=19){
document.f.d.value=("Aries")}
 
else if(x=="Apr" && y>=20 || x=="May" && y<=20){
document.f.d.value=("Taurus")}
 
else if(x=="May" && y>=21 || x=="Jun" && y<=20){
document.f.d.value=("Gemini")}
 
else if(x=="Jun" && y>=21 || x=="Jul" && y<=22){
document.f.d.value=("Cancer")}
 
else if(x=="Jul" && y>=23 || x=="Aug" && y<=22){
document.f.d.value=("Leo")}
 
else if(x=="Aug" && y>=23 || x=="Sep" && y<=22){
document.f.d.value=("Virgo")}
 
else if(x=="Sep" && y>=23 || x=="Oct" && y<=22){
document.f.d.value=("Libra")}
 
else if(x=="Oct" && y>=23 || x=="Nov" && y<=21){
document.f.d.value=("Scorpio")}
 
else if(x=="Nov" && y>=22 || x=="Dec" && y<=21){
document.f.d.value=("Sagittarius")}
 
else if(x=="Dec" && y>=22 || x=="Jan" && y<=19){
document.f.d.value=("Capricorn")}
 
else if(x=="Jan" && y>=20 || x=="Feb" && y<=18){
document.f.d.value=("Aquarius")}
 
else if(x=="Feb" && y>=19 || x=="Mar" && y<=20){
document.f.d.value=("Pices")}
 
else{document.f.d.value=("Sorry")}
 
</script></body></html>
Link to comment
https://linustechtips.com/topic/502023-html-help/
Share on other sites

Link to post
Share on other sites

Check your syntax, for example <formname... should be <form name.... with a space.  Make sure you use double quotes where needed.

Guide: DSLR or Video camera?, Guide: Film/Photo makers' useful resources, Guide: Lenses, a quick primer

Nikon D4, Nikon D800E, Fuji X-E2, Canon G16, Gopro Hero 3+, iPhone 5s. Hasselblad 500C/M, Sony PXW-FS7

ICT Consultant, Photographer, Video producer, Scuba diver and underwater explorer, Nature & humanitarian documentary producer

Link to comment
https://linustechtips.com/topic/502023-html-help/#findComment-6702826
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×