Javascript and form states

Posted on 2012-08-14
Last Modified: 2013-11-19
I have a javascript I inherited and it seems that the if conditionals are not working correctly.

After reviewing it and trying some adjustments in how the elements are selected, I'm still baffled with the if conditional if ('foo' == "BAR") and why they are not interpreting the way the scripter expected.

Experts please have a look and make some n00b suggestions for me? Thanks!
Question by:kblack05
    LVL 11

    Author Comment

    shopping cart script needs mod
    LVL 49

    Expert Comment

    by:Julian Hansen
    Not sure what the qustion is here? Can you elaborate?
    LVL 11

    Accepted Solution

    First thing I'm curious about is that

    function changeCountry(country) {
        if (country == 'US') {

    produces a syntax error. It seems there are many ways to do the conditional formatting, so perhaps comparing a variable imported by the function must have double quotes?
    LVL 11

    Author Closing Comment

    The script is broken in several places, not practical for experts to answer.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now