SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2009
    Location
    NY
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    added inputbox after page is load needs help with data from inputbox

    I am using jquery and i add the input boxes but when i try to get data from them i can't any ideas
    Code:
    $("#addmore").click(function(){
        m=m+1;
        $("input:last").before("<p><input type=text id=l"+m+ "/></p>");
       	$("#result").text(m);
    });
    $("#submitnumblinks").click(function(){
    var i=1;
    for (i=1;i<=m;i++)
    {
    var temp=document.getElementById("l"+i).value;
    $("#result").html("<p>[img]"+temp+"[/img]</p>");
    }
    });

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Look at the value of m. What is it before you do anything to it?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •