Checkbox unchecked alert? - solved!

    Date: 09/03/07 (PHP Community)    Keywords: no keywords

    Hi there,

    I have a sign up form which is working perfectly except for one thing; no matter how I phrase it, I cannot get an alert to display when a checkbox is unchecked. The code works perfectly for the textboxes that use it, but the checkbox won't behave. Is there a fundamental difference I'm missing here?

    Here's two examples from the form; the company name part is working fine, but the terms simply won't register an alert.

    Company Name: (*) 
                    
                ">


    Please tick this box to confirm that you accept our terms and conditions.


    function ValidateSignupForm(x){
                if(x.company.value==""){
                    alert("");
                    x.company.focus();
                    return false;
                }   
                if(x.terms.value==""){
                    alert("You must agree to our terms and conditions in order to join.");
                    x.terms.focus();
                    return false;
                }


    Any thoughts would be greatly appreciated. Thank you in advance.

    Solved! Thanks to luminairex and cyclotron!

    Source: http://community.livejournal.com/php/582681.html

« Memory profiling || Help with DodosMail »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home