ID:264309
 
obj/Voting
Team_Deathmatch
icon = 'Tdm.dmi'

html += "<a href=?[O.name]><IMG CLASS=icon SRC=\ref[O.icon] border=0></a> - [O.desc]" // this is what I use to pass the href to client/Topic()

client/Topic(href) // receive the href
world << "[src.mob] has voted for [href]"


It should output "Andre-g1 has voted for Team Deathmatch" but it instead shows "Andre-g1 has voted for Team."

For some reason it's not passing the '_Deathmatch' in which the _ should count as a space. What could be wrong ?
world << "[src.mob] has voted for [href]"
//to
world << "[src.mob] has voted for [html]"
//Maybe that'll do it?
In response to Mizukouken Ketsu
The html isn't on client/Topic() <.<

I browse() html to a person on a popup that then passes the href on to Topic().
In response to Andre-g1
Holy crap I totally missed that lol. Sorry ^-^; *tries to wake up*
In the future it'd probably be better to show a little more of the context of the code in question, since we didn't see where the O var was declared/set and could only assume its properly set to a value of such an obj like you suggested. >_>
The problem is that in order to set an HTML attribute (such as href) to a value with spaces, you need to enclose the value in quotes (either single or double ones; in DM of course single ones are more convenient).
Fixed by using url_encode and url_decode.

:)
In response to Kaioken
Kaioken wrote:
The problem is that in order to set an HTML attribute (such as href) to a value with spaces, you need to enclose the value in quotes (either single or double ones; in DM of course single ones are more convenient).

I tried that, it didn't work though. After paying a visit to chatters I was told to use url_encode and url_decode, and it did work.
In response to Andre-g1
Works for me. How did you try it? Encoding the URL is probably going too far for something simple like this.
In response to Kaioken
html += "<a href=?\'[O.name]\'><IMG CLASS=icon SRC=\ref[O.icon] border=0></a>  -  [O.desc]<br><br>"

</DM>

If that's what you mean, I output the href Topic() gets and it's « 'Team », without the «».
In response to Andre-g1
You're supposed to enclose the entire value itself in the quotes, standard HTML ( <tag attribute="value"> ), so you need to include the question mark in them. Also, you don't need to escape single quotes, only double ones.
In response to Kaioken
Ah, I see. I'm not really good with html :/

Anyways, that still won't send it right. It sends Team%20Deathmatch instead of Team_Deathmatch. So I'm guessing I really have to go with url_encode and url_decode.