Insert javascript into input field

Discussion in 'JavaScript' started by bryanfl100, Aug 9, 2010.

  1. #1
    How do I insert this javascript: <script language="JavaScript" type="text/javascript" src="http://www.ABC.com/members/display.php?token=email"></script>

    Into the values of this:
    <input id="Email" name="Email" type="text" size="30" /><input name="emailagent" type="HIDDEN" class="textfield" id="emailagent" value=''INSERT JAVASCRIPT" />
     
    bryanfl100, Aug 9, 2010 IP
  2. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #2
    I'm not getting what you mean. That is not javascript, that's a form. But it doesn't have any action or method attribute, so I'm assuming action is that display.php. So maybe you meant this?
    
    <form action="http://www.ABC.com/members/display.php" method="POST">
    <input id="Email" name="Email" type="text" size="30" /><input name="emailagent" type="HIDDEN" class="textfield" id="emailagent" value=''INSERT JAVASCRIPT" />
    </form>
    
    HTML:
    If not, then please elaborate.
     
    Rainulf, Aug 9, 2010 IP
  3. ChamlingDibya

    ChamlingDibya Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i think this will help:

    <input id="Email" name="Email" type="text" size="30" /><input name="emailagent" type="HIDDEN" class="textfield" id="emailagent" value=''<script language='JavaScript' type='text/javascript' src='http://www.ABC.com/members/display.php?token=email'></script>"/>
     
    ChamlingDibya, Aug 9, 2010 IP
  4. ChamlingDibya

    ChamlingDibya Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    changes you have to implement are underlined.
     
    ChamlingDibya, Aug 9, 2010 IP
  5. nikywm

    nikywm Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I believe he wants to insert the output of this page 'http://www.ABC.com/members/display.php?token=email' into the value of input id="emailagent"
    If this is the case, it can be done with ajax.
     
    nikywm, Aug 12, 2010 IP