Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onclick doesn't work..:( 2

Status
Not open for further replies.

brianpercival

Programmer
Jun 13, 2005
63
US
I have on a button a simple onclick="location.href='<cfoutput>#CGI.SCRIPT_NAME#</cfoutput>?&add=yes'"

(the cfoutput tags are coldfusion, just ignore them)

and the onclick doesn't work.. :(

thinking it is a coldfusion problem I tried with
and it doesn't work either.

however if I put a alert('hi') before the location.href, I see the alert.

can anyone plz tell me what's happening?

regards,
Brian
 
Show your output code for that input, the HTML generated by Cold Fusion. We need to see the WHOLE tag, not just a few of the parts inside.

Lee
 
trollacious,

I found out why. the page is divided into frames, and this button is in one of the frames, so just a location.href wouldn't do. if I do a document.location.href, then it is working. Thanks for the response.

regards,
Brian
 
brian, the .href is actually unnecessary - you could use just document.location = "blah.html"



-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
headbang.gif
[rockband]
headbang.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top