Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

strange onclick

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
"on click" or "onclick" ?
 
Priyanka Chopda
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
yeah its "onclick"!sorry for mistyping...any idea why I get this error??
-PC
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
Don't play dumb with me! But you can try this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    Bookmark Topic Watch Topic
  • New Topic