Results 1 to 3 of 3

Thread: Help me with my script please !

  1. #1
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Unhappy Help me with my script please !

    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 !!

    Code:
    <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>

  2. #2
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default ...

    nobody even a clue ?
    still couldnt get it to work..

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

    thx again

  3. #3
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Arrow ...

    hm, ok.. i found the error...
    the problem was this part ->

    PHP Code:
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •