• Post Reply 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

html select onchange problem

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to call a javascript function using html select onchange in struts?
eg;
<html:html>
<head>
<script>
function fun1()
{
var id=document.getElementById("category").value
if (id != 0)
{
alert("Please Select a Subcategory");
document.form.id.focus();
return false
}

}</script>
</head>
<body>
<html:from action="/set.do" >
<html:select property="name" onchange="javascript:func()"/>
</html:form>
</body>
</html:html>
I am using Struts 1.2.9 so I cant put the name attribute in form.Pliz help me.
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ingoba Ningthoujam:



where you write your function "func"?
 
Ingoba Ningthoujam
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Struts 1.2.9 so I cant put the name attribute in form.I want to call an action through javascript function.Pliz help me.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ingoba Ningthoujam:




syntax error:
 
reply
    Bookmark Topic Watch Topic
  • New Topic