假设表单处理脚本名为CitySearch.pl,则action属性为: 如果它使用CGI模块解析表单提交,你可以这样做: 展开 | 选择 | Wrap | 行号 Hello, I have a new project. I created a Excel file that calculate Solar Power requirement base on someone location and electric consumption. It works nicely. Now I want to make a HTML model inspired from this file. The Insolation information would be stored in a separate file. The user will have to provide me with it''s city for the calculation to commence. I don''t know how to use the <FORM> tag in Perl to accept input from users. The first thing the user need to input is the city. I don''t know what to put for ACTION ? Expand|Select|Wrap|Line Numbers 解决方案 is "the usual way"? The action attribute expects/requires a url, not a perl subroutine call. The url could be either a relative or absolute url. http://www.w3schools.com/tags/att_form_action.asp If you leave out the action clause, then it defaults to sending the form data to the same script that generated the form i.e., itself. The script would need to parse the form submission and then execute the Search_City_information subroutine passing it the city retrieved from the form submission. Assuming the form processing script is called CitySearch.pl, the action attribute would be: and if it is using the CGI module to parse the form submission, you could do something like this: Expand|Select|Wrap|Line Numbers 这篇关于使用Perl表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-29 09:05