ID:272549
 
Lots of you are familiar with that makes a neat submit button that submits all data in a ''form'' to client/Topic().

However, is there anyway to get ''submit'' to work WITHOUT using a ''Button''? Such as, using a hyperlink that will act the same as submit?
Mista-mage123 wrote:
Lots of you are familiar with <input type="submit"> that makes a neat submit button that submits all data in a ''form'' to client/Topic().

However, is there anyway to get ''submit'' to work WITHOUT using a ''Button''? Such as, using a hyperlink that will act the same as submit?

I was wondering the same thing also, becasue I was wanting to use an image submit button on a choices popup window of a game I was working on, but I couldn't figure out how to use something other than a normal submit button.

I'd like to know that also.
In response to ElderKain
i don't really care about images. I just want it to be a hyperlink =/
In response to Mista-mage123
Mista-mage123 wrote:
i don't really care about images. I just want it to be a hyperlink =/

Yea but a hyperlink can go around an image, so pretty much it would be like the same thing, it's just i was mentioning that it could be used with an image also, lol.
Oooh, try this :D Tell me if it works also.

<a href="#" onClick="document.form.submit();">blabla</a>
In response to SubZeroChaos
no luck
In response to Mista-mage123
What did you do and what is the name of your form?

In response to SubZeroChaos
Correct me if I'm wrong, but isn't document.stuff javascript?
In response to Jeff8500
yep.

BYOND is a big nono for javascript
In response to Jeff8500
Yes... :D
In response to SubZeroChaos
Then wouldn't you have to enclose it in...

<SCRIPT language="JavaScript">
</SCRIPT>


tags?
In response to Jeff8500
I understand what you're talking about, but there are different cases in which you must take that action. And this is not one of those cases.
In response to Mista-mage123
Im pretty sure it does let you... Show me your code and give me the name of the form :D
In response to SubZeroChaos
k
    var/HTML={"<head><title>Deck Edit</title></head> <body bgcolor="#FFCC99"><div style="text-align:center";><div style="width:200px;height:100px;border:4px solid blue;">Duel Settings<br><br>
<form method="get">
<input type="hidden" name="action" value="charcreate2">
<input type="hidden" name="pass2mob">
Healthpoints: <select name="hpset">
<option value=50><b>50(D/R)</b></option>
<option value=100>100</option>
<option value=75>75</option>
<option value=40>40</option>
<option value=30>30</option>
<option value=20>20</option>
<option value=10>10</option>
<option value=1>1</option>
<a href="#" onClick="document.form.submit();">Commence Duel</a>
"}

src.delay=2
src << browse("[Message][HTML]","window=char_create;size=220x325;can_close=0;can_resize=0;title=Sup my homies")
In response to Mista-mage123
var/HTML={"<head><title>Deck Edit</title></head> <body bgcolor="#FFCC99"><div style="text-align:center";><div style="width:200px;height:100px;border:4px solid blue;">Duel Settings<br><br>
<form id="MyForm" name="MyForm" method="get">
<input type="hidden" name="action" value="charcreate2">
<input type="hidden" name="pass2mob">
Healthpoints: <select name="hpset">
<option value=50><b>50(D/R)</b></option>
<option value=100>100</option>
<option value=75>75</option>
<option value=40>40</option>
<option value=30>30</option>
<option value=20>20</option>
<option value=10>10</option>
<option value=1>1</option>
<a href="#" onClick="document.MyForm.submit();">Commence Duel</a>
"}

src.delay=2
src << browse("[Message][HTML]","window=char_create;size=220x325;can_close=0;can_resize=0;title=Sup my homies")
In response to SubZeroChaos
the hyperlink doesn't appear
In response to Mista-mage123
mob/Login()
src << browse("<a href=?Submit=LoginSubmit>Submit</a>")

client
Topic(href,href_list[])
if(href)
switch(href_list["Submit"])
if("LoginSubmit")
world << "YAY"


You mean like this?

Or you could style the button,

<code><input type="submit" id="submitB" value="go"> #submitB{ border:none; padding:0; margin:0; font-size:xx-small; text-decoration:underline; color:blue; background-color:transparent; } </code>
In response to A.T.H.K
Ah nvm. The javascript worked. Finally. Forgot to use the </select> tag.

Thank god. Thanks guys. Umm...how can I get a REF From the submit button? What i mean is, say i wanted to do something like this

    for(var/a in list1)
HTML+={"
<a href="#
[a]" src=[a] name="[a]" id="[a]" value="[a]" onClick="document.MyForm1.submit();">[a]</a><br> "}


How could i make it make my ''choice'' variable to be whatever I clicked in the list of hyperlinks?
In response to Mista-mage123
There is one problem with Javascript not everyone has it enabled the majority of people do, but a lot of people including i have it turned off it is quite evil.
In response to A.T.H.K
A.T.H.K wrote:
There is one problem with Javascript not everyone has it enabled the majority of people do, but a lot of people including i have it turned off it is quite evil.

Hmmm...

Everytime my window pops up, it's x axis is decreased by a couple of pixels. While it may not be such a problem, after a while the window goes off the screen if it appeared enough times o_O