Click to See Complete Forum and Search --> : Trying to replace a CSS button w/ an image button on a .ASP page, having issues.


BlackReefDesign
08-14-2010, 06:26 PM
Hello,

Here is the code excerpt as it stands now w/ the CSS button:



response.write "<div class=pcShowProductNFS>"
response.write pEmailText '// reason why it's not for sale
response.write "<br/>"
response.write "<input type=""button"" class=""submit2"" value=""find a dealer"" onclick=""window.location='viewContent.asp?idpage=4'"">"
response.write "</div>"


Notice the bolded text - that is the CSS button line. What I want to do is replace it with an image, and the image is located here:

http://www.gem-tech.com/store/pc/images/silencershops.jpg

Now, I've tried a few different things, but nothing has worked. Nothing is coming up on google search either.

Any help would be appreciated on this, I know this must be basic for you ASP guys but I am really having a hard time for some reason.

I did try this, but it did not work:



response.write "<div class=pcShowProductNFS>"
response.write pEmailText '// reason why it's not for sale
response.write "<br/>"
response.write "<input type=""image"" src""http://www.gem-tech.com/store/pc/images/silencershops.jpg"" onclick=""window.location='viewContent.asp?idpage=4'"">"
response.write "</div>"

yamaharuss
08-14-2010, 07:12 PM
oops.... try src=""

BlackReefDesign
08-14-2010, 07:25 PM
Excellent, well that worked! One problem though is the image is not linked correctly. The image now appears fine, but when you click on it, it takes you to a "not found" page. It's supposed to take you to: viewContent.asp?idpage=4 , but it doesn't. Here is the code as it sits now:

response.write "<div class=pcShowProductNFS>"
response.write pEmailText '// reason why it's not for sale
response.write "<br/>"
response.write "<input type=""image"" src=""http://www.gem-tech.com/store/pc/images/silencershops.jpg"" onclick=""window.location='viewContent.asp?idpage=4'"">"
response.write "</div>"

yamaharuss
08-14-2010, 07:43 PM
The link is working properly.. you just need to be sure that viewContent.asp exists in the same directory as the page with this script.

BlackReefDesign
08-14-2010, 07:48 PM
The link is working properly.. you just need to be sure that viewContent.asp exists in the same directory as the page with this script.

Hi yamaharuss,

The viewcontent.asp and the page in question are both in the same directory.

I even tried full URL for the link:

response.write "<div class=pcShowProductNFS>"
response.write pEmailText '// reason why it's not for sale
response.write "<br/>"
response.write "<input type=""image"" src=""http://www.gem-tech.com/store/pc/images/silencershops.jpg"" onclick=""window.location='http://www.gem-tech.com/store/pc/viewContent.asp?idpage=4'"">"
response.write "</div>"

You can see what I am talking about here if you click on 'Silencer Shops':

http://www.gem-tech.com/store/pc/viewPrd.asp?idproduct=50&idcategory=9

yamaharuss
08-14-2010, 07:53 PM
check your code. you do not have window.location

BlackReefDesign
08-14-2010, 08:17 PM
Ya I do, I temporarily took it out of the code to see if the link would start working, but I put it back and uploaded the new file. You must have checked the source during that timeframe.

Anyways, this is weird...can't quite figure out what the problem is

BlackReefDesign
08-17-2010, 12:50 PM
Any other suggestions?

I have had to revert back to the CSS button code temporarily, as the image button was not linking to the page it was supposed to

yamaharuss
08-17-2010, 01:15 PM
Your code posted works fine for me.

BlackReefDesign
08-17-2010, 01:21 PM
Your code posted works fine for me.

Nevermind, I had the developer fix it. Here is the code that ended up working:

response.write "<div class=pcShowProductNFS>"
response.write pEmailText '// reason why it's not for sale
response.write "<br/>"
response.write "<img src=""http://www.gem-tech.com/store/pc/images/silencershops.jpg"" onclick=""window.location='http://www.gem-tech.com/store/pc/viewContent.asp?idpage=4'"">"
response.write "</div>"