Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

input type

 
Giomar Guevara
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to call an action inside an input type, how can I do this? I tried the following but didn't work


"<";input type="image" src="../images/button_cancel.gif" alt="Cancel" title="Cancel" onclickk="/nserverManager/sam/blank.do"/">
"<";input type="image" src="../images/button_cancel.gif" alt="Cancel" title="Cancel" onclickk="a href='/nserverManager/sam/blank.do'">
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to javaranch.

Originally posted by Giomar Guevara:

"<";input type="image" src="../images/button_cancel.gif" alt="Cancel" title="Cancel" onclickk="/nserverManager/sam/blank.do"/">
"<";input type="image" src="../images/button_cancel.gif" alt="Cancel" title="Cancel" onclickk="a href='/nserverManager/sam/blank.do'">



correct onclickk with onClick then try.
 
Giomar Guevara
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know it is not correct...I wrote it like that so I could submit my message (with "onclick" the page was giving an error)

can anyone help me???

thanks
 
vishwanath nadimpally
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


onclick is a UI event. You can call a javascript function 'onclick' and redirect to the url you want to inside the javascript
[ October 19, 2006: Message edited by: vishwanath nadimpally ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has nothing to do with JSP. Moved to the HTML forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The value of onclick cannot be a URL. It must be Javascript, which (as was previously pointed out) can be used to redirect to the URL you want.

It's probably a good idea to get some basic HTML and Javascript skills under your belt if you are going to write web apps.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hint: you need to set document.location.href

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic