Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for Changing value of a text box is not working

Current License: CC BY-SA 4.0

19 events
when toggle format what by license comment
Feb 7, 2020 at 19:40 vote accept Community Bot
Feb 7, 2020 at 10:43 answer added codewithfeeling timeline score: 1
Feb 7, 2020 at 8:37 comment added user12823945 @ImanEmadi I've tried innerHTML, innerText and value, none work
Feb 6, 2020 at 23:16 comment added Iman Emadi have you tried innerText ?
Feb 6, 2020 at 23:09 history edited Jeff Sloyer CC BY-SA 4.0
added 30 characters in body
Feb 6, 2020 at 23:01 answer added Florian Schwalm timeline score: 0
Feb 6, 2020 at 22:49 history edited user12823945 CC BY-SA 4.0
added 43 characters in body
Feb 6, 2020 at 22:47 comment added user12823945 I have no clue what it could be so ill post the entire thing, i warn you, it is a mess
Feb 6, 2020 at 22:46 comment added user12823945 If you want, i can post the entire file somewhere, ill add a link here
Feb 6, 2020 at 22:44 comment added user12823945 @raffjones Just a Side-Note: If I use the console and check the value of the element, it shows the email, but it isnt actually displayed in the box...
Feb 6, 2020 at 22:44 comment added codewithfeeling @MartinNajemi I think you need to post more of your code. I tried what you posted and it works fine, as I said. So something else must be wrong.
Feb 6, 2020 at 22:43 comment added user12823945 @raffjones I removed the $.trim and it does not update
Feb 6, 2020 at 22:40 comment added codewithfeeling @MartinNajemi - I was just asking if you are sure jQuery is being loaded. I tried your code without $.trim and it works fine - the input does update.
Feb 6, 2020 at 22:40 comment added user12823945 Also the console is being logged to a line after this so that area works, i did something like this: document.getElementById('emailbox').value = email; console.log("Log Test");
Feb 6, 2020 at 22:40 comment added Gershom Maes Note that you can also simply say if (email) { /* ... */ }
Feb 6, 2020 at 22:39 history edited user12823945 CC BY-SA 4.0
added 104 characters in body
Feb 6, 2020 at 22:38 comment added user12823945 @raffjones About the mixing and matching the jquery, the section works and i have no actual need to change it if it works, i replaced document.getElementById("emailbox").value = email; with alert("test") to see if it was being executed and it was, so there are no issues there. I also changed the if statement to email !== "" as you suggested and no changes
Feb 6, 2020 at 22:35 comment added codewithfeeling The code is a little odd in that you are mixing and matching vanilla JavaScript with the jQuery $.trim function. Maybe a silly question but are you sure you are loading jQuery? It is also preferable to use if (email !== "") not if(!email == "") And have you tried logging each step to the console?
Feb 6, 2020 at 22:24 history asked user12823945 CC BY-SA 4.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /