Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Get dynamic Text fields values

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Get dynamic Text fields values

    IN This Code i'm Creating some dynamic Text Fields But i can't get the dynamic text fields Values .. Please anyone help me to get the dynamic Text Fields Values

    function addTexfields() {
     
    document.getElementById("DivTag").innerHTML="";
     
    //Create an input type dynamically.
    var RoomNo = document.getElementById('txtInventory').value;
     
    var i=0;
    for (i=0;i<RoomNo;i++)
    {
    var element = document.createElement("input");
     
    var type2 = "text";
    var type3 = "Textfield1";
    //Assign different attributes to the element.
    element.setAttribute("type", type2);
    element.setAttribute("id", type3);
     
     
    var foo2 = document.getElementById("DivTag");
    foo2.appendChild(element);
     
    }
    }

    HTML PAGE

    <input type="text" name="txtInventory" id="txtInventory" onkeyup="addTexfields()" />
    <td><div class="cap2" id="DivTag"></div></td>


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Get dynamic Text fields values (Please Help Me to fix this problem)

    John, this is JavaScript not Java. The two are different languages. I suggest you look for a dedicated JavaScript forum.

    On another note, posting 3 of the same threads won't help you get your questions answered any quicker. This goes for all forums.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. #3
    Junior Member
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Get dynamic Text fields values

    sorry i just post because i think i can get a idea if any1 knows , absolutely I'm sorry

Similar Threads

  1. repeat creation of text fields
    By kurt-hardy in forum AWT / Java Swing
    Replies: 1
    Last Post: December 6th, 2010, 12:05 PM
  2. Dynamic compilation problem
    By hemanth.yerra in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 29th, 2010, 10:51 AM
  3. Putting text fields in an array
    By Movies32 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 10th, 2010, 07:46 PM