View Full Version : onClick Help
GhettoT
02-28-2007, 01:43 AM
OK, So I am making my own custom guestbook. And I have a part at the bottom that inputs all the stuff into a DB, what I want is to have it so that when you clic k it, it will take you to another page aswell as input the information. Here is what I have so far...
<input name="add" type="submit" id="add" value="Post Comment" onClick="location.url='http://www.team330.org/'">
thetestingsite
02-28-2007, 02:13 AM
Why not just make the script/program redirect to the new page after the item has been saved, instead of using the onClick method. Just a suggestion.
Blake
02-28-2007, 03:28 AM
I wrote my own guestbook for my band's website. I'll show you the code if you think it would be helpful.
BLiZZaRD
02-28-2007, 04:30 AM
Blake, no offense man, you do have some nice scripts. But have you ever thought about actually helping someone with their script problem, instead of substituting your works for theirs?
Sometimes people want to do things on their own and get a little stuck. Perhaps instead of giving them an alternative, and something you have done on your own then demanding a spot on their site for thanks, perhaps you could just answer their question?
If you actually wrote all those scripts that you seem to have on your site, answering these questions should be rather simple for you, yes?
Blake
02-28-2007, 04:41 AM
Blake, no offense man, you do have some nice scripts. But have you ever thought about actually helping someone with their script problem, instead of substituting your works for theirs?
Sometimes people want to do things on their own and get a little stuck. Perhaps instead of giving them an alternative, and something you have done on your own then demanding a spot on their site for thanks, perhaps you could just answer their question?
If you actually wrote all those scripts that you seem to have on your site, answering these questions should be rather simple for you, yes?
If you look through the forums, you'll find a number of threads where I've done just that. However, I don't always have time to find the answer. Don't you think that in those situations, if I happen to have working code that does what someone asks about, it would be useful to see it? If I'm trying to solve a problem, even if I write my own code, I find it helpful to see a working example that does something similar when I'm really stuck.
As far as demanding credit, the only time I did that is when I gave a complete script to a user who asked for it in the forum intended for that purpose. Even then I didn't demand credit. I asked nicely. In fact, I didn't ask for anything more than DD asks.
And yes, I wrote every script I have posted, unless otherwise stated.
At any rate, I understand that I do not make the rules on this forum, and if posting bits of my code when I don't have time to come up with a better answer is looked down on, I won't do it. I'm just trying to help in whatever way I have time for, though.
BLiZZaRD
02-28-2007, 05:04 AM
Hey, again I mean no offense, it wasn't an attack.
I don't go following people around the forum, and I don't go and read all of everyone's posts. The 20 or so that I have seen of yours though all follow the same method.
Person X comes in with a problem on something they have worked on, gotten to a stuck point, and usually it is a simple error or a common fix, and instead of saying such, you want them to go to your site and get a script that you wrote and implement that on their site.
All I was saying is that for more than just me, people here like to learn how to do something, and many are experimenting with new things.
Take the guestbook here for example, If I had spent the last few days writing a nice guestbook script for my site, and I had a small error somewhere I couldn't find and asked about it here, and someone came along saying "here this is my script it works great use that instead" I would tend to ignore that person.
There is no downside, and I think it is great that you can offer such help, but if I want an answer to MY script to get it working, replacing it with yours is not what I am looking for.
Then you have the other people here that see the question, see you have "answered" it and leave it alone, then that original question never really gets answered.
It's just something to think about.
Since you have so many (and such nice) scripts laying around, instead of posting "here go see mine" perhaps you could show a snippet of your code where the issue in question was handled, and let the OP see how you did it and try to implement themselves.
Again, I mean no harm just trying to get as many people complete help around here as possible:)
Blake
02-28-2007, 05:11 AM
Hey, again I mean no offense, it wasn't an attack.
I don't go following people around the forum, and I don't go and read all of everyone's posts. The 20 or so that I have seen of yours though all follow the same method.
Person X comes in with a problem on something they have worked on, gotten to a stuck point, and usually it is a simple error or a common fix, and instead of saying such, you want them to go to your site and get a script that you wrote and implement that on their site.
All I was saying is that for more than just me, people here like to learn how to do something, and many are experimenting with new things.
Take the guestbook here for example, If I had spent the last few days writing a nice guestbook script for my site, and I had a small error somewhere I couldn't find and asked about it here, and someone came along saying "here this is my script it works great use that instead" I would tend to ignore that person.
There is no downside, and I think it is great that you can offer such help, but if I want an answer to MY script to get it working, replacing it with yours is not what I am looking for.
Then you have the other people here that see the question, see you have "answered" it and leave it alone, then that original question never really gets answered.
It's just something to think about.
Since you have so many (and such nice) scripts laying around, instead of posting "here go see mine" perhaps you could show a snippet of your code where the issue in question was handled, and let the OP see how you did it and try to implement themselves.
Again, I mean no harm just trying to get as many people complete help around here as possible:)
Ok, I understand what you're saying. I didn't mean to suggest that you were attacking me. Seeing examples of working code does help me, but I understand that that may not help everybody. I'll limit posting entire scripts to when a user asks for an entire script. If I think that seeing part of one of my scripts may help a user in the future, I'll be sure to only post those specific parts that will be helpful.
BLiZZaRD
02-28-2007, 05:13 AM
I think it would help everyone. Part of the good of this forum is the ability (unlike others of this type) is that we try to answer full, complete, and with different options, because we all know that in 2 weeks another person will join trying to ask the exact same question.
If we can answer next weeks question today, all the better :)
thetestingsite
02-28-2007, 05:16 AM
I am going to step in here, no offense to Blizzard or Blake.
Instead of posting here (making more of a mess for the OP to read that really doesn't help out with their problem), why not just IM/PM each other about the posts.
Sorry, but don't feel that this is the place to be talking about what other posters should/should not do when posting.
BLiZZaRD
02-28-2007, 05:36 AM
Yes I agree, that is my fault.
DD can delete these posts as he sees fit.
GhettoT
02-28-2007, 05:49 AM
I do not mean to break up this love fest...:p BUt do any of you think you could help me out with my problem? And if you suggest something, could you post an example please?
thetestingsite
02-28-2007, 05:52 AM
As said in my first post:
Why not just make the script/program redirect to the new page after the item has been saved, instead of using the onClick method. Just a suggestion.
Depending on what language your program/script is in, this could be done by adding a header redirect (or equivalent [spelling?] if not written in PHP). In PHP though, you would do something like this once the data from the form is saved:
header('Location: http://www.mysite.com');
Hope this helps
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.