我想将多个输入字段传递给一个弹出页面。 这里是我做了什么:从多个输入字段传递值使用javascript/jquery弹出
<tr>
<th>Item Category</th>
<td><input type="text" name="object_category" disabled="disabled" id="pid1" />
</td>
<tr>
<th>Item Name</th>
<td><input type="text" name="object_name" disabled="disabled" id="pid2" />
<input type="button" id="item_name" name="choice" onClick="selectValue2('id2')" value="?"></td>
</tr>
是由不同的页面返回它的价值填补了价值。
现在我想通过使用javascript将id:pid1
和id:pid2
的值传递到新的弹出页面。 这里是我的selectValue2()
函数定义:
function selectValue2(pid2){
// open popup window and pass field id
var category = getElementById('pid1');
window.open("search_item.php?id=pid2&&cat="+category+""",'popuppage',
'width=600,toolbar=1,resizable=0,scrollbars=yes,height=400,top=100,left=100');
}
但是,selectValue2不工作,因为弹出窗口不开放。如何将这两个字段的值传递给我的新弹出窗口?
是'的getElementById( 'PID1')'是你自己的功能? – mohkhan