SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Values to textbox

    Code:
    input1
    input2
    input3
    input4
    
    A (condition x -> TRUE)
    
    "hello" + input1;
    "test";
    textbox write values A, B, C, D
    
    B (condition y -> TRUE)
    
    "hello2" + input2;
    "test2";
    textbox write values A, B, C, D
    
    C (condition z -> TRUE)
    
    "hello3" + input3;
    "test3";
    textbox write values A, B, C, D
    
    D (condition w -> TRUE)
    
    "hello4" + input4;
    "test4";
    textbox write values A, B, C, D
    How implement this? I tried..

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have this code:

    Code:
    if (document.getElementById("text").value != "") {
                        code = "";
                        code += cd;
                        code += document.getElementById("hi").value;
                        code += cd2;
                        code += document.getElementById("hy").value;
                        code += cd3;
                        code += document.getElementById("he").value;
                        code += cd4;
    		    code += "\n\n";
    		    code+='test';
    		    code+="test1";
    
                        document.getElementById("textareavalue").value += code;
                        SAVE VALUE IN NEW VARIABLE
    }
    
    if (document.getElementById("texty").value != "") {
                        code = "";
                        code += cd;
                        code += document.getElementById("hi4").value;
                        code += cd2;
                        code += document.getElementById("hy2").value;
                        code += cd3;
                        code += document.getElementById("he21").value;
                        code += cd4;
    		    code += "\n\n";
    		    code+='test11';
    		    code+="test122";
    
                        document.getElementById("textareavalue").value += code;
                        SAVE VALUE IN NEW VARIABLE2
    }
    I have a few if's and everything is being stored in a variable in order to be shown in a textarea.
    How do I save the values ​​if each in different variables?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •