如何在perl中创建警告框?例如,如果用户按下默认设置按钮。菜单会弹出并询问"您确定要继续吗?"价值介于"是"或"不"。我不确定perl是否可以启用警报框。在这段代码中,我只需要按下默认设置,然后将用户带到另一个页面,但现在我希望我可以从任何愿意帮助我的人那里得到帮助,并告诉我如何在用户按下时制作警告框"默认设置"按钮,用户点击"是"后,用户将转到另一页。
以下是代码:
#!/usr/bin/perl
#index.cgi
require 'foobar-lib.pl';
ui_print_header(undef, $module_info{'desc'}, "", undef, 1, 1);
ui_print_footer("/", $text{'index'});
print "Content-type:text/html\n\n";
print qq~<html>
<link rel="stylesheet" type="text/css" href="style.css">
<body>
<div id="content">
<div id="bar">
<span><p>Voice</p></span>
</div>
<div id="main-container">
<table width="100%" height="100%">
<tr>
<td width="30%" align="left">
<div id="title"><span>BYPASS :</span></div>
</td>
<td width="35%">
<div id="form">
<form method="POST" action="index2.cgi">
<select name="vdgpb" size="1">
<option value="bypass_a">VOC_BYPASS_A</option>
<option value="bypass_b">VOC_BYPASS_B</option>
<option value="bypass_c">VOC_BYPASS_C</option>
<option value="bypass_d">VOC_BYPASS_D</option>
</select>
</td>
<td align="left">
<input type="radio" name="pb" value="1">High (1)
</br>
<input type="radio" name="pb" value="0">Low (0)
</div>
</td>
</tr>
<tr>
<td colspan="3">
<div id="description"><b>Description :</b></div>
</td>
</tr>
<tr>
<td colspan="3">
<div id="button">
<input type="submit" value="Submit"><input type="reset" value="Clear">
</form>
</div>
</td>
</tr>
<tr>
<td wiidth="30%" align="left">
<div id="title"><span>SELECTION A :</span></div>
</td>
<div id="form">
<form method="POST" action="index3.cgi">
<td width="35%">
<select name="vdgph" size="1">
<option value="sel_a">SEL A</option>
<option value="sel_b">SEL B</option>
<option value="sel_c">SEL C</option>
<option value="sel_d">SEL D</option>
</select>
</td>
<td align="left">
<input type="radio" name="ph" value="1">High (1)
</br>
<input type="radio" name="ph" value="0">Low (0)
</div>
</td>
</tr>
<tr>
<td colspan="3">
<div id="description"><b>Description :</b></div>
</td>
</tr>
<tr>
<td colspan="3">
<div id="button">
<input type="submit" value="Submit"><input type="reset" value="Clear">
</form>
</div>
</td>
</tr>
<tr>
<td width="30%" align="left">
<div id="title"><span>IMPEDENCE</span></p>
<p><span>SELECTION :</span></p>
</div>
</td>
<div id="form">
<form method="POST" action="index4.cgi">
<td width="35%">
<select name="vdgpk" size="1">
<option value="z1_a">Z1_A</option>
<option value="z1_b">Z1_B</option>
<option value="z1_c">Z1_C</option>
<option value="z1_d">Z1_D</option>
<option value="z2_a">Z2_A</option>
<option value="z2_b">Z2_B</option>
<option value="z2_c">Z2_C</option>
<option value="z2_d">Z2_D</option>
</select>
</td>
<td align="left">
<input type="radio" name="pk" value="1">High (1)
</br>
<input type="radio" name="pk" value="0">Low (0)
</div>
</td>
<tr>
<td colspan="3">
<div id="description"><b>Description :</b></div>
</td>
</tr>
<tr>
<td colspan="3">
<div id="button">
<input type="submit" value="Submit"><input type="reset" value="Clear">
</form>
</div>
</td>
</tr>
<tr>
<td colspan="3">
<div id="button">
<form action="index5.cgi"
<input type="submit" value="Default Settings">
</form>
</div>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
~;