因此,我的CGI Perl中有一个按钮。单击该按钮时,我需要在perl CGI中分配一个操作,单击该按钮时,将在同一页面中打开一个具有指定宽度的新文本区域,并带有一个提交按钮。请帮助我如何继续。下面的代码对我来说并不是很有效。单击提交按钮后,我将如何通过电子邮件将消息发送到电子邮件id
我在这里打印按钮
print button('email',"email me","reqts()");
下面是opentextarea
子例程
sub reqts {
print "<p><em>Enter your Message here</em><br>";
print textarea(-name=>'Comments',
-rows=>10,
-columns=>50);
print submit('Action','Send');
}
单击此按钮时,不会调用子例程。
此按钮位于另一个子例程中的html表单上
sub actions {
print
start_html(),
start_form(-action => 'com.pl'),
submit(-name => 'submit', -value => 'View com.pl'),
end_form,
print button('email',"email me","reqts()"), # this is the button
start_form(-action => 'about.pl'),
submit(-name => 'submit', -value => 'About Us');
end_form,
end_html;
}
发布于 2013-06-06 16:19:31
Perl属性(button
的第三个参数)应该是一个JavaScript函数,而不是Perl函数。你应该学习CGI和网页是如何工作的。
https://stackoverflow.com/questions/16955410
复制相似问题