File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Error in HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Error in HTML" Watch "Error in HTML" New topic
Author

Error in HTML

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
The following is a piece of code from my JSP. I get an error on the javascript portion taht says illegal character. How can I add javascript to a button that will populate a text field?


[ May 11, 2007: Message edited by: Steve Dyke ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Please be sure to post HTML and Javaascript questions in the appropriate forum. This has been moved there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

This is not a dig of any kind, but are you learning HTML from a book that was published 10 years ago?

The <font> tag is long ago deprecated in favor of CSS, and modern conventions use lowercase for HTML tags. The all uppercase tags are incredibly hard to read.

All that said, please give us more details regarding the exact nature of the error, as on initial inspection I do not see the problem.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
you do not put the javascript inside of the button tag

you should just be adding onclick="yourFunction()" to the tag and have the script somewhere else on the page.

Eric
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
I now have the javascript working as long as my input number does not have a space in it. Example: AMS 2351 will caise a runtime error saying expected a ";"

My script code:

Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Steve,

that makes sense: numbers just don't have spaces.

Herman
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in HTML
 
Similar Threads
Disply data in browser color wise
Changing the color of a String variable
How to check if textboxes are null
Change Disabled Button Label Text and Its Shade Color
Dynamic JSP