Onclick Text

Discussion in 'JavaScript' started by dew1234, Mar 7, 2013.

  1. #1
    Hi everyone,
    I am building a page similiar to this: Example
    i have most of it done so far: My code
    I just don't know how to create a function to:
    Onclick text --> text appears in input boxes
     
    Solved! View solution.
    dew1234, Mar 7, 2013 IP
  2. #2
    I am not a good programmer, but I try your code :

    in fruits link change :
    <a href="#" onclick="show_visibility('foo1','myinput','some fruits here!')">
    Code (markup):
    added myinput and 'some fruits here' text to pass to function show_visibility.

    function visibility change to :
    function show_visibility(IDS,txtb,thetext){
      hide_visibility();
      document.getElementById(IDS).style.display = 'block';
      document.getElementById(txtb).value=thetext;
    }
    Code (markup):
    hope that help and probably other member have a better solution..
     
    bluebenz, Mar 8, 2013 IP
  3. dew1234

    dew1234 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    I have already found a solution! Thank you so much for your response though!
     
    dew1234, Mar 8, 2013 IP