Copy link to clipboard
Copied
Here I am again!
I need to pass three fields via input/onclick. The first is a constant, and the next two string variables. I have to use input because the user wants a button to push. This is a bummer because <a href works great. It's that darn button!
Here's the code:
<input type="button" name="addnew" value="Add New Leave Request"
onclick="location.href='index.cfm?fuseaction=add_new_leave&leave_id=A&user_id=#UserID#&user_name=#UserName#'">
I get to index.cfm, and to the correct fuse action. But when I perform a dump of the URL at this point, all I get is:
leave_id A
user_id [empty string]
fuseaction add_new_leave
No mention of user_name at all. CFOUTPUT statements before the input statement indicate that UserID and UserName have valid values. I figure the problem has to be with the way I am formatting the onclick clause, but just can't figure out what the problem is.
Any suggestions?
You're correct - the syntax is fine (The space after the 'A' was a typo here). I tried the button image, but we don't have any cool tools here that create decent looking buttons - just Paint (shudder).
What did I forget?
To wrap the input statement in a cfoutput tag.
As soon as I did that, instant success. Of all the crazy things, a simple cfoutput.
Copy link to clipboard
Copied
Hi,
Rename the variable 'UserID' and try.
Or clear your browser cookie and then try.
Copy link to clipboard
Copied
Why not get an image of a button and put it in an anchor tag?
Copy link to clipboard
Copied
Well, there doesn't seem to be anything obviously wrong with your syntax (except for what looks like a space after the "A"):
A &user
If that doesn't fix the issue, dump out your URL scope on the index.cfm. If your variables are showing up, then the issue is with fusebox not correctly passing your request variables on to the specified fuse. Unfortunately, that is an area in which I can't help.
Copy link to clipboard
Copied
You're correct - the syntax is fine (The space after the 'A' was a typo here). I tried the button image, but we don't have any cool tools here that create decent looking buttons - just Paint (shudder).
What did I forget?
To wrap the input statement in a cfoutput tag.
As soon as I did that, instant success. Of all the crazy things, a simple cfoutput.