[thelist] Form Submission (POST)

Karen J. Bowen karen at miinx.com.au
Mon Jun 17 03:56:01 CDT 2002


Burhan Khalid wrote:
> What I would like, is one form, but two buttons. One for forward, and
> one for backward.

Burhan, I think you need to do something like this:

<form action="<?= $currentPage; ?>" method="post">
	<input type="hidden" name="verb" id="verb" value="prev">
	<input type="hidden" name="item_id" value="<?= $prevVal; ?>">
	<input type="button" value="&lt;&nbsp;&lt;"
onclick="processSubmit('prev', '<?= $prevVal; ?>')">
	<input type="button" value="&gt;&nbsp;&gt;"
onclick="processSubmit('next', '<?= $nextVal; ?>')">
</form>

Then have the function:

function processSubmit(sVerb, sId) {
	document.getElementById("verb").value = sVerb;
	document.getElementById("item_id").value = sId;
	document.forms[0].submit()
}

Note that I've changed the name of your 'id' field slightly, as you
ideally shouldn't use another html element/attribute name.

hth
Karen
------------
Miinx Design & Development
e :: karen at miinx.com.au
p :: +614 1388 0302
w :: www.miinx.com.au




More information about the thelist mailing list