PDA

View Full Version : Help me with my script please !



kobo1d
07-03-2007, 09:33 PM
Hi there.. i have this script, which checks input values and radio button values..
The normal input check works sweet, but the radio-box check has a problem.. well i get the alert window, but when i press ok, the page still loads and does not return false..
at the normal inputs the page stops loading when i click ok.. can anybody help me plz ?! thx !!


<script type="text/javascript">

function checksubmit()
{

var radio_choice = false;
for (counter = 0; counter < form1.modus.length; counter++)
{
if (form1.modus[counter].checked)
radio_choice = true;
}
if (!radio_choice)
{
alert("Select your Live-Mode !!")
document.getElementById("form1").modus.focus()
return false
}

if (document.getElementById("form1").artist.value == "")
{
alert("Enter your Artist-Name !!")
document.getElementById("form1").artist.focus()
return false
}

if (document.getElementById("form1").title.value == "")
{
alert("Enter your Show-Title !!")
document.getElementById("form1").title.focus()
return false
}

return true
}

</script>

kobo1d
07-05-2007, 09:06 PM
nobody even a clue ?
still couldnt get it to work..

or do you need more code.. from the form ?

thx again

kobo1d
07-12-2007, 10:46 PM
hm, ok.. i found the error...
the problem was this part ->


document.getElementById("form1").modus.focus()

so since the element is a radio-button choice, i cant put that there..
so the script had an error and didnt returned false (at the next line)

solved & can be closed