• 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

Problem in action servlet?

 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to all,

I have one action servlet,

i print two lines like
html+="& lt;script language=\"javascript\"& gt;function validate(){alert(\"inside check\");}& lt;/script& gt;";
html+="& lt;input type=\"button\" value=\"submit\" onclic=\"validate()\"& gt;";

1.one javascript function named as validate()
2.another one is button and onclick validate function defined above.

and printed.
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println(html);
out.flush();

When i click the button, i get one error, like validate is not defined.

Why?
Please rectify this problem. Thanks
[ September 15, 2006: Message edited by: edward durai ]
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I am getting one exception like

Error: uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMWindowInternal.back]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: http://localhost:8080/AuditFindings/CustomCombo2.jsp :: onclick :: line 1" data: no]

Please rectify this problem

Thanks
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this a Struts question? What does the generated html file look like when you view the source from the browser?

- Brent
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic