Jump to content

Using onclick


ryanlum

Recommended Posts

hey..i tried it already...but it doesn't seem to be working... i don't know why......any idea??must you add it into a form???anywayz.. i try adding it into a form.. but it still doesn't work...i am using a submit button.. is that right? there are several different meanings for buttons?can anyone pass me a full sample code?thx...

Link to comment
Share on other sites

hey guyz.i want to use onclick for a submit button. whats the code for it?i tried onclick="location.herf('hello.jsp')"but it doesn't work... it sends me to a blank page

Hello, try:<input type="button" value="Click here" onclick="window.location.href='hello.jsp';" />Hope it helps.lugos
Link to comment
Share on other sites

Whats the difference between the button type "submit" and "button"?I can't seem to find the difference.......i got a very wierd problem... i tried this onclick="location.href='hello.jsp'"/> it works when I created a dummy script for it, but when i ported the command to my scripts... it doesn't seem to work. Any ideas?

Link to comment
Share on other sites

?this is how i want the website to work... i got 2 pages button A and B.. in page A there is a button linking to page B. i just want to direct the user from page A to page B.. without passing any values...both of the pages are in the same directory... so i was thinking of using the onclick button... for the button in page A

Link to comment
Share on other sites

but i do not want to point it to a webpage...
The point he's trying to make, is that if you first try to link to something like google.com, or for example http://www.w3schools.com, and see if that works. Because if that works, there's something wrong with how you referred to your file in the href=""
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...