HTML text field input can only accept 1 or 0 as a value in Perl -
may ask, how can html accept text field input 1 or 0 value? can show me? implement html in perl.
here example of code:
#!/usr/bin/perl #index5.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>data gateaway</p></span> </div> <div id="main-container"> <table border="0" width="100%" height="100%"> <tr> <td colspan="5"> <div id="button"> <form action="index.cgi"> <input type="submit" value="back"> </form> </div> </td> </tr> <tr> <td width="25%" align="left"> <div id="title"><span>bypass :</span></div> </td> <td width="20%"> <form method="post" action="index7.cgi"> <td width="20%"> <table border="0" style=\"text-align:top;font-family:arial, helvetica, sans-serif;\" cellpadding="5"> <tr> <td width="20%"><div id="data">use either "1" or "0" change value <b>basics bypass</b>:</div></td> </tr> </table> </td> <td align="left" width="7%"> <table border="0" style=\"text-align:center;font-family:arial, helvetica, sans-serif;\" cellpadding="2"> <td> <tr> <td width="7%"> <input type="text" maxlength="1" name="voca" size="1"> </td> </tr> <tr> <td width="7%"> <input type="text" maxlength="1" name="vocb" size="1"> </td> </tr> <tr> <td width="7%"> <input type="text" maxlength="1" name="vocc" size="1"> </td> </tr> <tr> <td width="7%"> <input type="text" maxlength="1" name="vocd" size="1"> </td> </tr> </td> </table> </td> </tr> <tr> <td colspan="5"> <div id="description"><b>description :</b></div> </td> </tr> <tr> <td colspan="5"> <div id="button"> <input type="submit" value="change default settings"><input type="reset" value="clear"> </form> </div> </td> </tr> </table> </div> </div> </body> </html> ~;
what function must add text field input in html can accept value of 1 or 0 only? can teach me how? need use if..else statement?
in case think better use dropbox options of 1 , 0 in order make more intuitive. if want use textbox, make input type=number, , every time onchange event being called, validate current value , delete if invalid.
Comments
Post a Comment