Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error on Page!

Status
Not open for further replies.

CliveC

Programmer
Nov 21, 2001
1,222
US
Can anyone see what is wrong with this code. It works but it generates an "error on the page" message under IE.

Code:
<html><body><head>
<script type="text/javascript">
function selectall() {document.f.a=document.f.a.select()}
</script></head><body><form name="f">
<input name="a" type="text" size="32" value="some text" /><br />
<input type="button" value="Select All" onclick="selectall()" />
</form></body></html>

Clive
 

You're assigning a method to an object.

Dan


The answers you get are only as good as the information you give!

 

Sorry - you're not - you're assigning the result of a method to an object. Did you mean to assign it to the object, or to its value? Or are you just wanting to select it?

Dan


The answers you get are only as good as the information you give!

 
Oh, I see [shadeshappy].

Code:
<html><body><head>
<script type="text/javascript">
function selectall() {document.f.a.select()}
</script></head><body><form name="f">
<input name="a" type="text" size="32" value="some text" /><br />
<input type="button" value="Select All" onclick="selectall()" />
</form></body></html>

Clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top