I'm trying to use Javascript's onclick submit function on the view file of Cakephp site and it doesn't seem to do anything when it's clicked...
Any suggestions?
<?php echo $form->submit(' Preview ', array('label'=>false,'name'=>'submit','id'=>'print_log')); ?>
<a id="print_log" href="#" onclick="this.form.submit()" name="submit">
<?php echo $html->image("b开发者_如何学Pythontn_preview.jpg",array("alt" => "Preview")); ?>
</a>
<a>
is not a form element (while <input>
or <button>
are), therefore this.form
is undefined for it.
It has nothing to do with CakePHP.
精彩评论