The input output by echo cannot call the onclick event.

Source: Internet
Author: User
The input output by echo cannot call the onclick event. & lt; SCRIPT & nbsp; language = JavaScript & nbsp; type = text/JavaScript & gt; function & nbsp; CheckAll (form) & nbsp; {for & nbsp; (var & nbsp; I = 0; input from I echo cannot be used to call the onclick event.

Function CheckAll (form ){
For (var I = 0; I Var e = form. elements [I];
If (e. name! = 'Chkall') e. checked = form. chkall. checked;
}
}

SCRIPT
Require_once 'sqlhelper. class. php ';
$ SqlHelper = new SqlHelper ();
$ SQL = "select * from user1 ";
$ Res = $ SqlHelper-> execute_dql ($ SQL );
$ Fields = mysql_num_fields ($ res );
$ Rows = mysql_num_rows ($ res );
Echo" ";
Echo" ";
For ($ I = 0; $ I <$ fields; $ I ++ ){
$ Fieldname = mysql_field_name ($ res, $ I );
Echo"$ Fieldname";
}
Echo"";
$ Num = 1;
While ($ row = mysql_fetch_row ($ res )){
Echo"";
Echo" ";
For ($ I = 0; $ I <$ fields; $ I ++ ){
Echo"$ Row [$ I]";
}
Echo"";
$ Num ++;
}
Echo"";
?>

Why does onclick = CheckAll (this. form) call js and share it with function? CheckAll (form )? {? (Var? I = 0;... 'data-pics = ''>
------ Solution --------------------
In addition, echo" "; Does not comply with php's conventions
------ Solution --------------------
This problem is most suitable for beginners to solve.

First, you need firefox and firebug plug-ins.

Then press F12 to enable this plug-in to refresh the page.

Then, if a JS error occurs in the "control" column, an error is reported, where is the problem?

If no error is reported, click this button and you will find the error.

For example, if I run your file and click that input



This form is undefined.

Moderator

If we don't have this capability, firebug will help us with special useful recommendations.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.