开发者

Cakephp javascript onclick submit function on view

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜