Click here to Skip to main content
15,918,889 members
Home / Discussions / JavaScript
   

JavaScript

 
Questionintegrate bidichecker to awebsite Pin
nada200615-Aug-12 17:42
nada200615-Aug-12 17:42 
Questioneither my css or Javscript is in error, another set of eyes Pin
jkirkerx15-Aug-12 13:19
professionaljkirkerx15-Aug-12 13:19 
AnswerRe: either my css or Javscript is in error, another set of eyes Pin
jkirkerx15-Aug-12 16:32
professionaljkirkerx15-Aug-12 16:32 
AnswerRe: either my css or Javscript is in error, another set of eyes Pin
BobJanova15-Aug-12 23:36
BobJanova15-Aug-12 23:36 
QuestionDisplay Values Pin
lakshmiblp15-Aug-12 10:29
lakshmiblp15-Aug-12 10:29 
Questionhow to get default signature in outlook using Javascript Pin
Anurag Sinha V9-Aug-12 2:20
Anurag Sinha V9-Aug-12 2:20 
AnswerRe: how to get default signature in outlook using Javascript Pin
Pete O'Hanlon9-Aug-12 3:52
mvePete O'Hanlon9-Aug-12 3:52 
AnswerRe: how to get default signature in outlook using Javascript Pin
BobJanova9-Aug-12 3:56
BobJanova9-Aug-12 3:56 
Newsurdu Pin
sania habib8-Aug-12 15:47
sania habib8-Aug-12 15:47 
GeneralRe: urdu Pin
Richard MacCutchan8-Aug-12 21:28
mveRichard MacCutchan8-Aug-12 21:28 
AnswerRe: urdu Pin
Rahul Rajat Singh22-Aug-12 1:24
professionalRahul Rajat Singh22-Aug-12 1:24 
GeneralRe: urdu Pin
Sandip.Nascar22-Aug-12 11:03
Sandip.Nascar22-Aug-12 11:03 
QuestionLooping through elements, to find textbox, and get values Pin
jkirkerx8-Aug-12 13:12
professionaljkirkerx8-Aug-12 13:12 
AnswerRe: Looping through elements, to find textbox, and get values Pin
jkirkerx8-Aug-12 18:13
professionaljkirkerx8-Aug-12 18:13 
GeneralRe: Looping through elements, to find textbox, and get values Pin
Andrei Straut9-Aug-12 4:41
Andrei Straut9-Aug-12 4:41 
GeneralRe: Looping through elements, to find textbox, and get values Pin
jkirkerx9-Aug-12 6:27
professionaljkirkerx9-Aug-12 6:27 
AnswerRe: Looping through elements, to find textbox, and get values Pin
Andrei Straut9-Aug-12 9:37
Andrei Straut9-Aug-12 9:37 
GeneralRe: Looping through elements, to find textbox, and get values Pin
jkirkerx9-Aug-12 10:18
professionaljkirkerx9-Aug-12 10:18 
GeneralRe: Looping through elements, to find textbox, and get values Pin
Andrei Straut9-Aug-12 10:35
Andrei Straut9-Aug-12 10:35 
AnswerRe: Looping through elements, to find textbox, and get values Pin
Andy Brummer9-Aug-12 10:26
sitebuilderAndy Brummer9-Aug-12 10:26 
GeneralRe: Looping through elements, to find textbox, and get values Pin
jkirkerx9-Aug-12 16:54
professionaljkirkerx9-Aug-12 16:54 
GeneralRe: Looping through elements, to find textbox, and get values Pin
Andy Brummer10-Aug-12 4:56
sitebuilderAndy Brummer10-Aug-12 4:56 
GeneralRe: Looping through elements, to find textbox, and get values Pin
jkirkerx10-Aug-12 6:31
professionaljkirkerx10-Aug-12 6:31 
QuestionGet value from textbox created with createElement Pin
jkirkerx6-Aug-12 15:48
professionaljkirkerx6-Aug-12 15:48 
Well I'm getting bolder here with Javascript.

This eludes me, I can create a element and set the value no problem, I can get the value via Jquery no problem if the element is pre-dom, but if I create an element with createElement, I was thinking since my element is new in the DOM, it would be easy to retrieve the value via function. I'm missing something really basic here in principal, and this is the first time I have created a textbox this way.

It's written to be compatible with IE and Firefox browsers at the same time, in a single version.

I keep getting 'undefined' as the value of the code textbox. The function works, I just can't the appendCode from the textbox.

I've tried 3 versions so far. Just thought I'd ask, tomorrow I will have a fresh hat on to think with.

The Element
var txt_Element_L1_Code_Field = document.createElement("input");
    txt_Element_L1_Code_Field.id = "_txt_Element_L1_Code_Field_" + dynamicCart_Element1.idx;
    txt_Element_L1_Code_Field.type = "text";
    txt_Element_L1_Code_Field.style.paddingLeft = "5px";
    txt_Element_L1_Code_Field.style.width = "90%";
    txt_Element_L1_Code_Field.style.backgroundColor = "rgb(255,255,255)";   
    td_Element_L1_Code_Field.appendChild(txt_Element_L1_Code_Field);


Version 1 function that is binded
txt_Element_L1_Code_Field.onkeydown = function () {
        var appendCode;
        if (txt_Element_L1_Code_Field.innerText != "") {
            appendCode = txt_Element_L1_Code_Field.value;
        }

        span_Element_L1_CPN_Field.innerText = appendCode;
        span_Element_L1_CPN_Field.innerHTML = appendCode;
    };


Version 2: function that is binded
txt_Element_L1_Code_Field.onkeydown = function () {
        var appendCode;
        if (txt_Element_L1_Code_Field.innerText != "") {
            appendCode = txt_Element_L1_Code_Field.innerText;
        }
        else if (txt_Element_L1_Code_Field.innerHTML != "") {
            appendCode = txt_Element_L1_Code_Field.innerHTML;
        }

        span_Element_L1_CPN_Field.innerText = appendCode;
        span_Element_L1_CPN_Field.innerHTML = appendCode;    
    };

Version 3:
I lost it, gone
AnswerRe: Get value from textbox created with createElement Pin
BobJanova7-Aug-12 0:12
BobJanova7-Aug-12 0:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.