HTML field not updated

rss

Posted by Helge - Mar 2 ’16 at 10:34

Hi

I am creating a HTML script but can't find a way to define a global variable that works in and outside of my procedures, any suggestions?

Second question, since I can't manage to define a global variable I tought that I could use a html text field named "TaskId" as a workaround.

using the logic below, but altough the field is updated the IF function does not work before i enter the script again - its not updated while I am "in" the script?

 

$('#TaskId').attr('value', 'fant');

if (document.getElementById("TaskId").value=="fant") {alert("fant");} else {alert("fant ikke");}

  • rostislav
    rostislav
    Moderator
    Member for: 8 years 4 months 21 days
    #1 by rostislav Mar 3 ’16 at 05:55

    1. To make a variable global you can assign it to the global object, which is, in case of browsers, window:

    var myvar = "my variable";
    
    window.myvar = myvar; 

    2. You are setting the 'value' attribute of the input element, not the content of the box. Try this:

    $('#TaskId').val('fant');
    
    if (document.getElementById("TaskId").value=="fant") {
    
     alert("fant");
    
    } else {
    
     alert("fant ikke");
    
    }
  • Ben Tredin
    Member
    Member for: 2 years 1 month 13 days
    #2 by Ben Tredin Aug 12 ’21 at 09:02

    Following the ctfo gummies reviews , the product provides customers with beneficial and pleasurable usage. Affordable cost and advantageous properties will add to the experience.

    td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}https://cbdgummiesforpain.org/reviews/ctfocbd-gummies


  • jenniferduran
    Member
    Member for: 2 years 1 month 11 days
    #3 by jenniferduran Aug 14 ’21 at 07:52

    It is just what I was looking for and quite thorough as well. Thanks for posting this, I saw a couple other similar posts but yours was the best so far. The ideas are strongly pointed out and clearly emphasized. I don't suppose Ive read anything like this before. So nice to seek out any individual with some original ideas on this subject. Really thanks for beginning this up. This web site is one thing that's wanted on the net, someone with somewhat originality. Useful job for bringing something new to the web

  • Tom Brown
    Member
    Member for: 2 years 3 months 20 days
    #4 by Tom Brown Aug 20 ’21 at 05:50

    I was amazed that I could get best essay writing help on my Sociology paper. I had such a difficult topic! But the specialist coped with it and found reliable sources.

  • michael343
    Member
    Member for: 2 years 1 month 2 days
    #5 by michael343 Aug 23 ’21 at 10:30

    Thanks for sharing this amazing post. In need of the best Assignment writing service turnout to Assignments Planet for all assignment services at a cheap price.

  • BeckHassen
    Member
    Member for: 2 years 30 days
    #6 by BeckHassen Aug 26 ’21 at 06:56

    Need to pay someone to do your assignment? Then you've come to the right place. Here you can count on expert help. Now you don't need to write papers in person.

  • BeckHassen
    Member
    Member for: 2 years 30 days
    #7 by BeckHassen Aug 26 ’21 at 06:56

    Need to pay someone to do your assignment? Then you've come to the right place. Here you can count on expert help. Now you don't need to write papers in person.

  • helpinhomework123
    Member
    Member for: 2 years 2 months 20 days
    #8 by helpinhomework123 Sep 18 ’21 at 10:15

    Forget paying hundreds for paid guest posts backlinks based on organic traffic or domain authority alone. Great Guest Posts is the best and professional link-building Platform and fits with your pocket. Find a new path to reach your niche audience in moments by browsing through our extensive catalog of websites that accept guest posts!

  • helpinhomework123
    Member
    Member for: 2 years 2 months 20 days
    #9 by helpinhomework123 Sep 18 ’21 at 10:16

    Best Buy Hacks experts share the best products that you should buy. We're a team of savings professionals delivering the best deals, tips and tricks to help you save at your favorite brands, stores and restaurants.

     

     

     

     

  • helpinhomework123
    Member
    Member for: 2 years 2 months 20 days
    #10 by helpinhomework123 Sep 18 ’21 at 10:23

    You are in the final year of your graduate degree program and you are supposed to write an essay and submit it in just a week. You already have your hands full because an exam is coming up, you have to participate in a quiz etc. And on top that you are doing a part time job to fund your education. Don’t worry. Help in Homework offers academic essay writing services to students for a very low cost so get rid of that stress and just get in touch with us!

Displaying 1 to 10 of 28 messages
Previous123