ID:270295
 
How would i amke a browser popup useing htmllib ive been messing around in it but i cant seem to do it.
Here's a little short thing on how to do forms with the browser and Topic(), if that's what you're wanting.

        usr<<browse({"
<html>
<body>
<form name="input" action="?" method="get">
<input type="hidden" name="action" value="CreateCharacter">
<b>Name: </b><input type="text" name="user" value="
[usr.key]">
<br><br>
<b>Gender:</b>
<input type="radio" name="gender" value="male" checked><b>Male</b>
<input type="radio" name="gender" value="female"><b>Female</b>
<br><br>
<b>Race:</b> <select name="race">
<option value="Human">Human
<option value="Elf">Elf
</select>
<br><br><center><input type="submit" value="Submit"></center>
</form>
</body>
</html>
"}
,"window=CreateACharacter")

So, you have to send the forms in GET method with ? as the action, you can't send any additional information in the action attribute so if you want to send in something to, say, determine the action to take, then you'll need to use hidden input types. Interpreting in Topic(), or in this example client/Topic(href,list[]), you would just switch to list["action"], check if the action is CreateCharacter, then use the information(list["race"],list["gender"],etc) to do whatever you like.
In response to Artemio
How does client/Topic() work anyway. I just can't get the hang of it..
In response to Mysame
client/Topic(href,list[])

- href is basically a text string of params2list(list)
- list[] is an associative list of all information sent in.

So, say for example you send in an input named "Value" and a value of 15. Href would be this- "Value=15", list[] would look like list("Value"="15").
Say you sent in a few arguments.. "Value" is "15", "Item" is "Milk", and "Shopkeeper" is "Gerald". href would look like "Value=15&Item=Milk&Shopkeeper=Gerald", and list[] would look like list("Value"="15","Item"="Milk","Shopkeeper"="Gerald").

The way you send in things is by using the ? symbol in an HTML tag such as <a> or <form>, and an example:
mob/Login()
src<<browse({"<a href="?action=Close&windowtoclose=LoginWindow">Close This Window!</a>","window=LoginWindow"})
client/Topic(href,list[])
if(!list["action"])return
switch(list["action"])
if("Close") if(list["windowtoclose"]) mob<<browse(null,"window=list["windowtoclose"]")
..()
In response to Artemio
Artemio wrote:
So, say for example you send in an input named "Value" and a value of 15. Href would be this- "Value=15", list[] would look like list("Value"=15).

It actually wouldn't be 15 as a number, but "15" as a text string, so you would have to text2num that out yourself.

~~> Unknown Person
In response to Unknown Person
Woops, was tweaking the message and didn't notice that. Thanks.