私のPHPページの下部にいくつかの段落があります。ユーザーがドロップダウンからオプションを選択するたびに、次の関数が呼び出されて、そのオプションの値がURL変数に追加されます。現在のところ、このページは毎回トップに更新され、大きな問題です。通常は、次のようなものを使用します:onclick = "window.location = 'page.htm#bottom';"ページの一番下まで更新しますが、#bottomを追加すると下の関数は機能しなくなります。誰かがこの機能を調整するのを助けたり、機能が完了したときにページの一番下までリフレッシュする他のアイデアを教えてくれますか? self.location='add_products.php#bottom?fda=' + fda
URLの変数を含むjavascript関数を使用してページの一番下まで表示します
をしかし、これは行います:
function reload5(form){
if(document.getElementById('fda1').checked) {
var fda = '1';
}else if(document.getElementById('fda0').checked) {
var fda = '0';
}
var val=form.category.options[form.category.options.selectedIndex].value;
var val2=form.subcat.options[form.subcat.options.selectedIndex].value;
var val3=form.subcat1.options[form.subcat1.options.selectedIndex].value;
var val4=form.subcat2.options[form.subcat2.options.selectedIndex].value;
var comp1=form.mname.options[form.mname.options.selectedIndex].text;
var itemnum=document.getElementById('item').value;
var desc=document.getElementById('desc').value;
var quan=document.getElementById('quan').value;
var list=document.getElementById('list').value;
var uom=form.uom.options[form.uom.options.selectedIndex].text;
self.location='add_products.php#bottom?fda=' + fda + '&desc=' + desc + '&quan=' + quan + '&list=' + list + '&uom=' + uom + '&item=' + itemnum + '&cat=' + val + '&cat2=' + val2 + '&cat3=' + val3 + '&cat4=' + val4 + '&comp=' + comp1 ;
}
だから、これは動作しませんself.location='add_products.php?fda=' + fda
任意のアイデアどこ#bottomを入れて?
あなたの命を救う人。本当にありがとう。特にコードを整理するため。理由は私はまだアヤックスに行っていない、私は初心者ですが、私はこのページを書いた昨年、本当に初心者でした。私はおそらく今すぐ離陸することができただけでそれに慣れていない。再度、感謝します! –