【发布时间】:2014-06-04 19:25:12
【问题描述】:
您好,我想知道如何使用脚本在 cakephp 中显示警报...我有这个表格
<div class="soyaproductorcompras form">
<h3>Registro de Compra de Grano </h3>
<?php echo $this->Form->create('SoyaProductorCompra');?>
<fieldset>
<?php
echo $this->Form->input('soya_proveedor_id', array( 'options' => $soyaproveedores,'empty' => '--Porfavor Seleccione Proveedor--','label' => 'Por Favor Seleccione a algun Proveedor de la lista' ));
echo $this->Form->input('producto', array(
'options' => array(
'GRANO DE SOYA' => 'Grano de Soya',
'GRANO DE GIRASOL' => 'Grano de Girasol'
), 'label'=>'Tipo de Grano '
));
echo $this->Form->input('toneladas', array('label' => 'Cantidad en tonelada(s) métrica(s) del producto (TM)','style'=>'width:500px; height:30px;','default'=>0));
echo $this->Form->input('preciodolar', array(
'label' => 'Precio en Dolares Americanos por tonelada métrica (TM / $us)',
'style'=>'width:500px; height:30px;',
'default'=>0));
echo $this->Form->input('total', array('label' => 'Total en Dolares Americanos ($us)','style'=>'width:500px; height:30px;','default'=>0));
echo $this->Form->input('fecharegistro', array('dateFormat' => 'DMY', 'minYear' => date('Y')-3,
'maxYear' => date('Y') + 1, 'label' => '<strong>Periodo al que corresponde la declaración jurada</strong>','empty'=>false, 'type'=>'date'));
echo $this->Form->submit('Agregar Existencia', array('class' => 'form-submit', 'title' => 'Presione aqui para agregar datos'));
?>
</fieldset>
<?php echo $this->Form->end(); ?>
</div>
所以我不知道如何以及在何处放置脚本以及如何调用它...此表单为 DB 发送数据..该部分运行良好!...但我的客户希望看到一个带有类似这样的消息“您确定要保存此表单吗??”他点击是或否请帮忙!!!
【问题讨论】:
-
所以写一些javascript来拦截表单提交并显示一个确认框。这不是 CakePHP 特有的,可以相对容易地完成。 stackoverflow.com/questions/6515502/…
-
这里有类似的问题---stackoverflow.com/questions/5455092/…
-
谢谢@cillosis 我看到了这个问题,我开始搜索 html 而不是 cakephp 解决方案,现在我的代码可以工作了!..我将为想要相同的人提供 tje 解决方案...谢谢又来了!
-
@Tasos 谢谢我看到了解决方案并帮助了我这么多!!!谢谢!..我很高兴成为starkoverflow这个家庭的一员!!...谢谢!!
标签: javascript php cakephp-2.0 cakephp-2.3