SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Checkboxes

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Checkboxes

    I have a row of checkboxes that each has a date as a value. I would like to have users be able to select a date and have that value appear in a textbox on a form and then if they selected another date or dates to have that value appear on another textbox on the form. I am a complete novice with regards to javascript but if someone could point me in the right direction I would be grateful

    Thanks

  2. #2
    SitePoint Evangelist SpaceFrog's Avatar
    Join Date
    Jan 2005
    Location
    Outerspace
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you mean that on a click of a checkbox you want a texbox to be added ?

    I would have a litlle script do that for me ...
    Code:
    var NewBox=document.createElement('input')
    NewBox.type='textbox'
    document.myform.appendChild(NewBox)

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No , what I meant was that on a click of a checkbox I want the value of that checkbox inserted in to a textbox

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    document.getElementById("checkbox1").onclick = function() {
      document.getElementById("textbox1").value = this.value;
    }
    etc.
    Birnam wood is come to Dunsinane


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
  •