wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Javascript and 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 "Javascript and "value=" attribute of input tag." Watch "Javascript and "value=" attribute of input tag." New topic
Author

Javascript and "value=" attribute of input tag.

Gabriel Allen
Greenhorn

Joined: Jan 09, 2007
Posts: 12
Is there anyway to use a javascript value in the value attribute of an input tag?

Ex:
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
you can set the value with JavaScript with some sort of action



Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

I prefer to avoid references such as forms[0] because the code may break if the form changes position on the page.

Give the form an explicit name and use it, or give the element an id and reference it directly.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Originally posted by Bear Bibeault:
I prefer to avoid references such as forms[0] because the code may break if the form changes position on the page.

Give the form an explicit name and use it, or give the element an id and reference it directly.


Bear,

You use more than one form on a page? Geesh...lol

FYI: name is depretiated now on a form element if you care about standards!

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript and "value=" attribute of input tag.