|
查看: 906|回复: 13
|
html 和java scripts
[复制链接]
|
|
|
我現在要做一張html form有java scripts 來驗証。我可不可以把這張form所填的資料然後再顯示在另一張html page 就像comfirmation page。最後在comfirmation page 裡加一個button 來寄出去。
請問java scripts 需要什麼code? 請大家指教一下。謝謝 |
|
|
|
|
|
|
|
|
|
|
发表于 5-9-2008 08:20 AM
|
显示全部楼层
回复 1# roy16 的帖子
是可以的.... 这是我个人的想法...
先 open (URL, windowName[, windowFeatures])
就像
a=window.open("","","width=200,height=300").document;
然后
a.open();
a.write(你要show的资料);
a.close(); |
|
|
|
|
|
|
|
|
|
|
发表于 5-9-2008 08:37 AM
|
显示全部楼层
|
我试看做个example吧.... (应该可以瓜....) |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-9-2008 09:06 AM
|
显示全部楼层
原帖由 mElO 于 5-9-2008 08:37 AM 发表 
我试看做个example吧.... (应该可以瓜....)
那我先謝謝你囉。
我也正在試一試。 |
|
|
|
|
|
|
|
|
|
|
发表于 5-9-2008 11:20 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 6-9-2008 09:25 AM
|
显示全部楼层
|
我試了你的Code。為什麼不能run。我還在研究當中你的code。 |
|
|
|
|
|
|
|
|
|
|
发表于 7-9-2008 12:02 AM
|
显示全部楼层
submit那個沒有放onclick event...- <html>
- <head>
- <script language="JavaScript" type="text/javascript">
- function submitform()
- {
- var f = document.getElementById('fname').value;
- var l = document.getElementById('lname').value;
- var e = document.getElementById('em').value;
- var p = document.getElementById('pno').value;
- var ad = document.getElementById('add').value;
- var c = document.getElementById('cn').options[document.getElementById('cn').selectedIndex].innerHTML;
- var popUp = window.open("","","width=500,height=500");
- popUp.document.open();
- popUp.document.writeln("<html></head><body><form action='' name='myform1'>");
- popUp.document.writeln("<table>");
- popUp.document.writeln("<tr><td align='right'>First Name: </td><td>"+f+"</td></tr>");
- popUp.document.writeln("<tr><td align='right'>Last Name: </td><td>"+l+"</td></tr>");
- popUp.document.writeln("<tr><td align='right'>EMail: </td><td>"+e+"</td></tr>");
- popUp.document.writeln("<tr><td align='right'>Phone: </td><td>"+p+"</td></tr>");
- popUp.document.writeln("<tr><td align='right'>Address: </td><td>"+ad+"</td></tr>");
- popUp.document.writeln("<tr><td align='right'>Country: </td><td>"+c+"</td></tr>");
- popUp.document.writeln("<tr><td align='right'></td><td><input type='button' value='Confirm'></td></tr>");
- popUp.document.writeln("</table></form></body></html>");
- popUp.document.close();
- }
- </script>
- </head>
- <body>
- <form action="" name="myform">
- <table cellspacing="2" cellpadding="2" border="0">
- <tr>
- <td align="right">First Name</td>
- <td><input type="text" id="fname" name="FirstName"></td>
- </tr>
- <tr>
- <td align="right">Last Name</td>
- <td><input type="text" id="lname" name="LastName"></td>
- </tr>
- <tr>
- <td align="right">EMail</td>
- <td><input type="text" id="em" name="Email"></td>
- </tr>
- <tr>
- <td align="right">Phone</td>
- <td><input type="text" id="pno" name="Phone"></td>
- </tr>
- <tr>
- <td align="right">Address</td>
- <td><textarea cols="20" rows="5" id="add" name="Address"></textarea></td>
- </tr>
- <tr>
- <td align="right">Country</td>
- <td>
- <SELECT id="cn" name="Country">
- <option value="" selected>[choose yours]
- <option value="008">Albania
- <option value="012">Algeria
- <option value="016">American Samoa
- <option value="020">Andorra
- <option value="024">Angola
- <option value="660">Anguilla
- <option value="010">Antarctica
- <option value="028">Antigua And Barbuda
- <option value="032">Argentina
- <option value="051">Armenia
- <option value="533">Aruba
- </SELECT>
- </td>
- </tr>
- <tr>
- <td align="right"></td>
- <td><input type="button" value="Submit" onclick="javascript:submitform();" ></td>
- </tr>
- </table>
- </form>
- </body>
- </html>
复制代码
[ 本帖最后由 cheng1986 于 7-9-2008 12:08 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
发表于 8-9-2008 08:37 AM
|
显示全部楼层
回复 6# roy16 的帖子
|
不好意思,我还没做完的.... 只供你参考.... |
|
|
|
|
|
|
|
|
|
|
发表于 8-9-2008 11:03 AM
|
显示全部楼层
为什么不把structure掰成这样??
form > confirm > send的页面来做呢??
就是把form post 到 confirm Page 去。。。。
然后从confirm page 再到 process send page ? |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 8-9-2008 04:01 PM
|
显示全部楼层
原帖由 lawty 于 8-9-2008 11:03 AM 发表 
为什么不把structure掰成这样??
form > confirm > send的页面来做呢??
就是把form post 到 confirm Page 去。。。。
然后从confirm page 再到 process send page ?
沒錯啊,你所提的也是一樣structure。我只是用java scripts 來做。 |
|
|
|
|
|
|
|
|
|
|
发表于 8-9-2008 04:46 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 8-9-2008 10:43 PM
|
显示全部楼层
覺得popup window比較煩....
照lawty所說的會比較好
不然就用ajax |
|
|
|
|
|
|
|
|
|
|
发表于 9-9-2008 10:03 AM
|
显示全部楼层
原帖由 mElO 于 8-9-2008 04:46 PM 发表 
你是不是说要用PHP???
asp, php, java, asp.net, vb.net 都可以。。。。。 |
|
|
|
|
|
|
|
|
|
|
发表于 9-9-2008 10:07 AM
|
显示全部楼层
回复 13# lawty 的帖子
|
哦... 是的... asp, php, java, asp.net, vb.net 还不是很强... |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|