私は、前方および戻るボタンを作成するJavaScriptをいくつか持っています。しかし、私はURL(?id=$idd
)にパラメータを渡す必要があります。JavaScriptを使用したURLパラメータの受け渡し
<a href="javascript:submitForm('mainForm','back');" title="Go back to the kit home page" style="float: left;"><img src="images/back.gif" alt="Go back to the kit home page" border="0" /></a>
<a href="javascript:submitForm('mainForm','proceed');" title="Submit the order details" style="float: right;"><img src="images/proceed.gif" alt="Proceed to the next page" border="0" /></a>
JavaScriptは以下の通りです:
// Used in all pages to submit a form and optionally set a hidden
// form varaible called 'navigate' to direct navgiation
function submitForm(formName, navigateValue) {
if (navigateValue != null && navigateValue != "") {
document.forms[formName].navigate.value = navigateValue;
}
document.forms[formName].submit();
}
感謝。
あなたの質問は何ですか? – Gumbo
まあ私の質問は、URLにvaribleを渡すにはどうすればいいですか?すなわち、続行がクリックされると、次のページに移動します。これは、URLにvaribleが付いています - http://www.xxxx.com/next-page.php?id = 1329 –
どちらの変数がありますか:navigateValue? "?id = $ idd"?その他? – annakata