facebook

Javascript -Noobie question re variables: CLOSED

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #345552 Reply

    jedmgrew
    Member

    Being a VB programmer taking the step to Java is proving pretty frustrating. I have a very uncomplicated app, but having spent hours trying to achieve a simple step thinking about going back to VB! I have a list, and two text boxes. When I selct an item from the list, I want the selection to appear in the top text box (All good so far, works ok). I then want to use the same variable in an if statement to display some different text in the second text box. I’ve attached the code if that helps. ListWord is the variable. Thanks in advance…

    [var ListWord = $(‘select[name=”list1″] :selected’).text()
    $(‘#m1-test2-text1’).text(ListWord);
    if (ListWord = “Mind Read”)
    {
    $(‘#m1-test2-text2’).text(“Mind Reading is fun”);
    }
    else
    {
    $(‘#m1-test2-text2’).text(“nope”);
    }]

    #345553

    Unknown Author
    Participant
    
    if (thing == thing2)
    

    == is a comparison, = is an assignment

    -1tc

    #345558

    jedmgrew
    Member

    What can I say….4 days wasted!! Worked perfectly the first time I put the == into the code. Thanks for taking the time to answer….will be purchasing Mobi One as a result, and have found an excellent beginners online Javascript course….

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Javascript -Noobie question re variables: CLOSED

You must be logged in to post in the forum log in