php - selecting field text with javascript -


I'm using code below to select field text with javascript but it does not work much:

// Automatically select field text field to easily coop material = paint document. Getalment BIID ('share_field_ & lt ;? php echo $ id;? & Gt;'); Content.focus (); Content.select ();

To select the field:

// Share field

  echo & lt; Div class = "name" style = "display: none" id = "share_field _". $ Line ['id']. ' '& Gt; & lt; input name = "share" type = "text" value = "http://www.site.com/play/' $ Line ['id']. '"Size =" 53 "> 

I think you should use something like this:

  var content = parent.document.getElementById ('share_field_ & lt ;? php echo $ id ;? & gt; ; ';); Content.firstChild.focus (); content.firstChild.select ();  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -