爲了與java腳本中的警報和提示對話框保持一致我在想是否有一個對話框,哪個駕駛室接受2個輸入而不是1個?具有2個輸入的java腳本對話框
我已經嘗試了幾個類似的方法:
創建表單
<form id="management_form">
Enter Option: <input type="text" id="optiontb" name="option">
<input type="button" onclick="myfunction(this.form)" value="submit"> </form>
,並呼籲
document.management_form.submit(); in the java script method
無論表單代碼是在HTMLFILE這顯示形式。而不是在形式的形式使用被稱爲
,創造
var newdiv = document.createElement();
newdiv.innerHTML = "Entry <br><input type='text' name='myInputs[]'>";
document.appendChild('newdiv');
爲了這個,我看到和錯誤未被捕獲的錯誤:NOT_FOUND_ERROR:DOM Exception8
有沒有更好的方法來做到這個 ?
編輯: 後執行一些操作如吉里什以下建議:
html代碼如下:
<title>
<style>
I have include the code for the style
</style>
<script>
function request()// renamed it here
{ // this is exactly same the code in the sample web site
}
我是多麼調用該Java腳本方法
function myfunction(frm)
{
var opt=frm.option.value;
request();
$("#dialog-form").dialog("open");
} 這被叫做
<form name="management_form">
Enter Option: <input type="text" id="optiontb" name="option">
<input type="button" onclick="myfunction(this.form)" value="submit"> </form>
任何可以在這裏添加的東西,以便它顯示爲一個對話框,而不是一個HTML頁面?
這是'document.body.appendChild('newdiv');' – Coder