www.webdeveloper.com
Results 1 to 3 of 3

Thread: Writing to multiple cells...

  1. #1
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114

    Writing to multiple cells...

    I have a script that will fill in a form that I am trying to perfect... so far, it works for entering text into one <span>, I would like it to enter the same text into multiple <span> areas onkeyup.

    Here is the JS Fiddle:
    http://jsfiddle.net/WaYAf/

    As you enter text into the input area, it automatically writes into the form... I need it to automatically enter into multiple instances... a bit stuck with that...

    Thanks!

  2. #2
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,268
    Repeat the line for conamediv2 (which is a span) or try this to fill all spans with an id beginning by conamespan (which length is 10)
    Code:
    function writetocell(){var i,l,mySpan=document.getElementsByTagName('span');
       var theValue=document.getElementById('coname');
       for (l=mySpan.length,i=0;i<l,i++) if (mySpan[i].id.substr(0,10)=='conamespan') mySpan[i].innerHTML=theValue;
    }

  3. #3
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    Thanks for the scripting advice, but I have not been able to get it to work.


    Is anyone able to get it working on jsfiddle?
    http://jsfiddle.net/WaYAf/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles