0

I'm trying to get a php variable to send alert box to user:

    var filial = '<?php echo $counta; ?>';

    if (filial=='0') {  
        if (formObj.dropdown1.value=='') {  
            alert('Filial');  
            return false;  
        }  
    } 

I think there is an error because alert is not showed...

Any tip to solve?

Thanks a lot

1
  • What is the output of your PHP script? What does your JavaScript console say? What is the value of filial at the if statement? Also, this probably isn't your issue, but use json_encode() when inserting values into JavaScript. Commented May 28, 2013 at 1:04

1 Answer 1

1

view-source and see if filial is initialized... Then check console for any JS errors.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.