|
Post by turbov21 on Dec 31, 2007 15:20:50 GMT -5
I'm not sure if there's an automated way to do this, as I just started playing with it, but I've figured out how to submit data with an HTML button the same way you would with a LINK command.
x = 0
[start]
cls
titlebar "count: "+str$(x)
html "<h1>" + str$(x) + "</h1>"
link #link, "Add 1", [addone] print "" link #link, "Add 2", [addtwo] print ""
html "<hr/>"
html "<input type=""button"" value=""Add 1"" onclick=""AddOne();""/>" html "<script type=""text/javascript"">" html "function AddOne() { " html " var x = document.getElementsByTagName(""form"")[0].name;" html " submitFormTriggeringCallback(x, '1', ""href"" );" html " return false;" html " }" html "</script>"
wait
[addone] x = x + 1 goto [start]
[addtwo] x = x + 2 goto [start]
submitFormTriggeringCallback is the JavaScript subroutine. I've got to dig into the internals a bit more, but I thought this proof of concept would pretty interesting.
|
|
|
Post by benjamin1 on Jan 12, 2008 12:38:03 GMT -5
hello,
when i run this code, the links work fine, but when I click the button, it takes me to the rb preferences screen.
Ben
|
|
|
Post by turbov21 on Jan 13, 2008 20:15:35 GMT -5
hello, when i run this code, the links work fine, but when I click the button, it takes me to the rb preferences screen. Ben Hmm. I'll have to look at that. Thanks for the info.
|
|
|
Post by turbov21 on Jan 18, 2008 16:20:43 GMT -5
What browser are you using?
|
|