Post Method
Page 1 of 19 Replies - 501 Views - Last Post: 12 March 2009 - 05:52 PM
#1
Post Method
Posted 12 March 2009 - 02:42 PM
Replies To: Post Method
#2
Re: Post Method
Posted 12 March 2009 - 02:48 PM
#3
Re: Post Method
Posted 12 March 2009 - 02:50 PM
#4
Re: Post Method
Posted 12 March 2009 - 02:54 PM
The link can be anything (div, text, img)
[code]
<a href='java script:void(0)' onclick='document.getElementById("myFormId").submit()'>
{link element}
</a>
[code]
#5
Re: Post Method
Posted 12 March 2009 - 02:56 PM
roudard, on 12 Mar, 2009 - 01:54 PM, said:
The link can be anything (div, text, img)
<a href='java script:void(0)' onclick='document.getElementById("myFormId").submit()'>
{link element}
</a>
OK, here is my form.
<form action="index.php?do=move" method="post"> <li><input name="north" type="submit" value="Move North" class="submit" /></li> <li><input name="west" type="submit" value="Move West" class="submit" /></li> <li><input name="east" type="submit" value="Move East" class="submit" /></li> <li><input name="south" type="submit" value="Move South" class="submit" /></li> </form>
Can you show me how to make those links with that method?
#6
Re: Post Method
Posted 12 March 2009 - 03:02 PM
laces12, on 12 Mar, 2009 - 01:56 PM, said:
roudard, on 12 Mar, 2009 - 01:54 PM, said:
The link can be anything (div, text, img)
<a href='java script:void(0)' onclick='document.getElementById("myFormId").submit()'>
{link element}
</a>
OK, here is my form.
<form action="index.php?do=move" method="post"> <li><input name="north" type="submit" value="Move North" class="submit" /></li> <li><input name="west" type="submit" value="Move West" class="submit" /></li> <li><input name="east" type="submit" value="Move East" class="submit" /></li> <li><input name="south" type="submit" value="Move South" class="submit" /></li> </form>
Can you show me how to make those links with that method?
hmmm, interesting...
i would introduce a direction field ..
<form action="index.php?do=move" method="post">
<input type='hidden' name='direction'>
<li><a href='java script:void(0)' onclick='document.getElementById("myFormId").direction.value="north";document.getElementById("myFormId").submit()'>
Move North</a></li>
//and so on...
</form>
The get the post value for direction
would that work ?
This post has been edited by roudard: 12 March 2009 - 03:03 PM
#7
Re: Post Method
Posted 12 March 2009 - 03:05 PM
roudard, on 12 Mar, 2009 - 02:02 PM, said:
laces12, on 12 Mar, 2009 - 01:56 PM, said:
roudard, on 12 Mar, 2009 - 01:54 PM, said:
The link can be anything (div, text, img)
<a href='java script:void(0)' onclick='document.getElementById("myFormId").submit()'>
{link element}
</a>
OK, here is my form.
<form action="index.php?do=move" method="post"> <li><input name="north" type="submit" value="Move North" class="submit" /></li> <li><input name="west" type="submit" value="Move West" class="submit" /></li> <li><input name="east" type="submit" value="Move East" class="submit" /></li> <li><input name="south" type="submit" value="Move South" class="submit" /></li> </form>
Can you show me how to make those links with that method?
hmmm, interesting...
i would introduce a direction field ..
<form action="index.php?do=move" method="post">
<input type='hidden' name='direction'>
<li><a href='java script:void(0)' onclick='document.getElementById("myFormId").direction.value="north";document.getElementById("myFormId").submit()'>
Move North</a></li>
//and so on...
</form>
The get the post value for direction
would that work ?
The link does nothing
#8
Re: Post Method
Posted 12 March 2009 - 03:10 PM
sorry the id='myFormId' attribute should be added to the form flag
you can even wrap it up nicely with a fucntion
function moveSomeWhere(direction) {
document.getElementById("myFormId").direction.value= direction;
document.getElementById("myFormId").submit();
}
and then
<form action="index.php?do=move" method="post" id="myFormId">
<input type='hidden' name='direction'>
<li><a href='java script:void(0)' onclick='moveSomeWhere("north")'>
Move North</a></li>
//and so on...
</form>
This post has been edited by roudard: 12 March 2009 - 03:11 PM
#9
Re: Post Method
Posted 12 March 2009 - 03:25 PM
roudard, on 12 Mar, 2009 - 02:10 PM, said:
sorry the id='myFormId' attribute should be added to the form flag
you can even wrap it up nicely with a fucntion
function moveSomeWhere(direction) {
document.getElementById("myFormId").direction.value= direction;
document.getElementById("myFormId").submit();
}
and then
<form action="index.php?do=move" method="post" id="myFormId">
<input type='hidden' name='direction'>
<li><a href='java script:void(0)' onclick='moveSomeWhere("north")'>
Move North</a></li>
//and so on...
</form>
Ok, i made it get method, and i sent me to this:
http://dragonkn.info...direction=south
I need it to be:
http://dragonkn.info...direction=south
This post has been edited by laces12: 12 March 2009 - 03:29 PM
#10
Re: Post Method
Posted 12 March 2009 - 05:52 PM
laces12, on 12 Mar, 2009 - 02:25 PM, said:
http://dragonkn.info...direction=south
I need it to be:
http://dragonkn.info...direction=south
i thought you needed it to be sent via post
just add an hidden field with name='do' and value='move'
|
|

New Topic/Question
Reply



MultiQuote




|