ryanlum Posted November 2, 2005 Share Posted November 2, 2005 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 Link to comment Share on other sites More sharing options...
maelstorm Posted November 2, 2005 Share Posted November 2, 2005 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<{POST_SNAPBACK}> This command seems to working fine.onclick="location.href='hello.jsp' "For New Window:window.open="hello.jsp";Hope it helped......... Link to comment Share on other sites More sharing options...
ryanlum Posted November 5, 2005 Author Share Posted November 5, 2005 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 More sharing options...
Chocolate570 Posted November 5, 2005 Share Posted November 5, 2005 Ya, there are different meanings. Use this:<input type="button" value="Change" onclick="window.location="hello.jsp"> Link to comment Share on other sites More sharing options...
lugos Posted November 6, 2005 Share Posted November 6, 2005 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<{POST_SNAPBACK}> 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 More sharing options...
ryanlum Posted November 6, 2005 Author Share Posted November 6, 2005 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 More sharing options...
Champion_Munch Posted November 6, 2005 Share Posted November 6, 2005 The "Submit" function is for forms that are filled out by visitors. Submit sends the information put into the form back to the website owner.Can you provide us with the entire script you're trying to use?Instead of using onclick, you could try using several "hidden" input tags.with regards Link to comment Share on other sites More sharing options...
F-Man Posted November 6, 2005 Share Posted November 6, 2005 I'll be the first one to suggest the onsubmit attribute. Link to comment Share on other sites More sharing options...
ryanlum Posted November 6, 2005 Author Share Posted November 6, 2005 ?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 More sharing options...
Champion_Munch Posted November 6, 2005 Share Posted November 6, 2005 Try replacing "hello.jsp" with a website that you know exists (ie. http://www.google.com). If it works when you click on that, then it has to be something to do with the filename rather than the syntax. :)with regards Link to comment Share on other sites More sharing options...
ryanlum Posted November 6, 2005 Author Share Posted November 6, 2005 hmmm...but i do not want to point it to a webpage... i want to point it to a page that i created locally...any idea? Link to comment Share on other sites More sharing options...
Jonas Posted November 6, 2005 Share Posted November 6, 2005 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 More sharing options...
ryanlum Posted November 7, 2005 Author Share Posted November 7, 2005 i tried the website method already...like what champion_munch said... it works....so is there anyway i can fix it? Link to comment Share on other sites More sharing options...
ryanlum Posted November 7, 2005 Author Share Posted November 7, 2005 I managed to solve the problem already.thx a bunch guyz Link to comment Share on other sites More sharing options...
Champion_Munch Posted November 7, 2005 Share Posted November 7, 2005 Glad you fixed it. What was the problem?with regards Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now