开发者

Cakephp javascript onclick submit function on view

开发者 https://www.devze.com 2023-03-21 00:08 出处:网络
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...

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消