- Joined
- Mar 27, 2024
- Messages
- 3
- Reaction score
- 0
Can't find what's wrong in my following code. See my notes in my code.
function formcheck(myform)
{with (myform)
alert(sel.value); <----note---------- Msg shows a "2"
if(sel.value==2)
{alert('OK');} <-----note--------- This msg never shows up and it should because above msg shows 2.
else{alert('not 2');return false;} <-----note-------Msg shows "not 2" and this should not happen a/c above msg shows a 2.
if(frdate.value == '' && todate.value == '')
{alert('TO DELETE A RANGE, DATES ARE REQUIRED.');return false;}}
"sel" is in HTML <input type='radio' name='selfunc' id='sel' value='2'>
Thanks for your help
function formcheck(myform)
{with (myform)
alert(sel.value); <----note---------- Msg shows a "2"
if(sel.value==2)
{alert('OK');} <-----note--------- This msg never shows up and it should because above msg shows 2.
else{alert('not 2');return false;} <-----note-------Msg shows "not 2" and this should not happen a/c above msg shows a 2.
if(frdate.value == '' && todate.value == '')
{alert('TO DELETE A RANGE, DATES ARE REQUIRED.');return false;}}
"sel" is in HTML <input type='radio' name='selfunc' id='sel' value='2'>
Thanks for your help