Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes strange onclick Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply locked New topic
Author

strange onclick

Priyanka Chopda
Ranch Hand

Joined: Jul 22, 2003
Posts: 112
hi ,
My code runs fine if its written in pure html
like this
code:
--------------------------------------------------------------------------------
<html>
<head>
<script>
function today(parameter){
var d = new Date();
var todaydate= d.getFullYear()+"-"+(d.getMonth() + 1)+"-"+d.getDate();
parameter.modificationDate.value=todaydate;return false; //Set this to "true" in production
}
</script>
</head>
<body>
<form name="abc" action="#">
<input type="text" name="modificationDate">
<input type="submit" on click="return today(this.form)">
</form>
</body>
</html>
--------------------------------------------------------------------------------
but fails if used with struts:html tag??
when I view source it gives object doesn't support this method or property at <input type="submit" value="Update Problem" on click="return today(this.form)">
any specific reason for this behavior??
thanks
-PC
Sainudheen Mydeen
Ranch Hand

Joined: Aug 18, 2003
Posts: 218
"on click" or "onclick" ?
Priyanka Chopda
Ranch Hand

Joined: Jul 22, 2003
Posts: 112
yeah its "onclick"!sorry for mistyping...any idea why I get this error??
-PC
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Isn't this the third time that this question has been asked here and here?
Priyanka, please do not post the same question multiple time, either in the same forum or across different forums. It causes multiple redundant conversations and just wastes peoples' time.
thanks,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: strange onclick
 
Similar Threads
Dealing with Users Pressing Enter in ASP
validation rules for time
onclick event
Validation for double in javascript
Which submit button was clicked?