• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 313
  • Last Modified:

Javascript homepage button acting wierd

Here's my code:

<INPUT TYPE="image"  SRC="images/homepage_button.jpg" width="200" height="17" border="0" onClick="this.style.behavior='url(#default#homepage)';
                        this.setHomePage('http://www.countryshowdown.com/Texaco/contestant.php?id=<?php echo $contestant_id; ?>');">
                        </FORM>&nbsp;

It works. My homepage becomes the page I've got referenced. The only snag is that as soon as youc click the button, the page gets an error because the URL has some random code as the id number, consequently you get all kinds of errors.

Again, the page is made the homepage, but in the process the page refreshes with the same URL, but you've got a different set of characters for the id number. In this case, instead of the URL being http://www.countryshowdown.com/Texaco/contestant.php?id=19022, instead the page you get after you click the button is http://www.countshowdown.com/Chevron/contestant.php?x=80&y=10

What am I missing?
0
brucegust
Asked:
brucegust
  • 3
  • 2
3 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
An 'image' button is a 'submit' button by definition and the "x=80&y=10" are the coordinates in the image where you clicked.
0
 
Dave BaldwinFixer of ProblemsCommented:
0
 
Ray PaseurCommented:
What are you trying to get to happen here.  Please just tell us in plain language, thanks. ~Ray
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Ray PaseurCommented:
Wonder if this design pattern might work - just use a link:
http://javascript.internet.com/miscellaneous/set-home-page.html
0
 
brucegustAuthor Commented:
Dave's suggestions explained where I was getting the bizarred URL (the x and y coordinates). I found another script that accommodated the button that I wanted to use as well as different browser types. That "direction" came about as an indirect result of Ray's suggestion which had sound code, but didn't accommodate anything other than IE. Taken together, we got it done!
0
 
Dave BaldwinFixer of ProblemsCommented:
Good, glad you got it done.  Thanks.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now