本文整理汇总了PHP中FormBuilder::setDefaultSubmit方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::setDefaultSubmit方法的具体用法?PHP FormBuilder::setDefaultSubmit怎么用?PHP FormBuilder::setDefaultSubmit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::setDefaultSubmit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormBuilder
<li>Aggiungere commenti a programmi, articoli, news</li>
<li>Accedere all'esclusiva newsletter dedicata alla programmazione</li>
</ul>
<div class="center">
<?php
$formBuilder = new FormBuilder("frm-register", "/restful/user/register.php");
$fields[] = array("id" => "username", "type" => "textinput", "label" => "Username:", "validation" => "required,Devi scegliere un username", "send" => false);
$fields[] = array("id" => "password", "type" => "textpassword", "label" => "Password:", "validation" => "required,Devi specificare una password", "send" => false);
$fields[] = array("id" => "hash", "type" => "hidden");
$fields[] = array("id" => "email", "type" => "textinput", "label" => "Email:", "validation" => array("valid_email,Devi specificare un'email valida", "required,Devi specificare un'email"));
$fields[] = array("id" => "question", "type" => "telinput", "label" => "Sette piu' tre?", "attrs" => "maxlength='2' size='2' style='width: auto;'", "validation" => "required,Devi rispondere alla domanda");
$formBuilder->addFields($fields);
$formBuilder->setDefaultSubmit("Registrati");
echo $formBuilder->render();
?>
</div>
<p>
<b>Nota: </b> come utente normale <u>non</u> potrai pubblicare programmi sul sito. Per pubblicare programmi sul sito consulta la sezione <a href="javascript:void(0);">Join Us</a><br><br>
</p>
<script>
"use strict";
// Prima dell'invio del form, offusca username e password
FormBuilder.On("frm-register", "PreSubmit", function(e){
var username = $("form[id='frm-register'] input[name='username']").val();
var password = $("form[id='frm-register'] input[name='password']").val();
var hash = Login.encrypt(username, password);
示例2: FormBuilder
</div>
<div class="center">
<?php
$formBuilder = new FormBuilder("message-write", "/restful/user/panels/messages/send.php");
$fields[] = array("id" => "to", "type" => "textinput", "label" => "A:", "validation" => "required,Specifica a chi inviare il messaggio");
$fields[] = array("id" => "subject", "type" => "textinput", "label" => "Oggetto:", "validation" => "required, Specifica l'oggetto");
// Aggiungi multiplo e importante solo se l'utente e' admin
if ($currentUser->isAdmin()) {
$fields[] = array("id" => "multiple", "type" => "checkbox", "label" => "Invia a tutti i membri:");
$fields[] = array("id" => "important", "type" => "checkbox", "label" => "Importante:", "value" => true);
}
$fields[] = array("id" => "message", "type" => "textarea", "validation" => "required,Devi scrivere un messaggio");
$formBuilder->addFields($fields);
$formBuilder->setCloseable(true);
$formBuilder->setDefaultSubmit("Invia");
$formBuilder->setVisible(false);
$formBuilder->addWidget(new BbButtonWidget($formBuilder->getDOMId("message"), "code|quote|g|c|s"));
$formBuilder->addWidget(new SmilesWidget($formBuilder->getDOMId("message")));
echo $formBuilder->render();
?>
</div>
<script language='javascript'>
"use strict";
var Messages = (function(){
var p = {
order : "date_desc",
folder : "",
folder_name : "",
important : false,
示例3: FormBuilder
</div> <!-- /forum-thread -->
<div style="text-align: right;">
<input type="button" value="Rispondi" id="btn-forum-reply" />
</div>
<div class="center">
<?php
$formBuilder = new FormBuilder("frm-forum-reply", "/restful/forum/reply.php");
$fields = array();
$fields[] = array("id" => "message", "type" => "textarea", "validation" => "required,Devi scrivere un messaggio");
$formBuilder->addValue("topic_id", $topic["id"]);
$formBuilder->addFields($fields);
$formBuilder->setCloseable(true);
$formBuilder->setDefaultSubmit("Rispondi");
$formBuilder->setVisible(false);
$formBuilder->addWidget(new BbButtonWidget($formBuilder->getDOMId("message"), "code|quote|g|c|s"));
$formBuilder->addWidget(new SmilesWidget($formBuilder->getDOMId("message")));
echo $formBuilder->render();
?>
</div>
<script>
"use strict";
$("#btn-forum-reply").click(function(e){
if (!$(this).hasClass("disabled")){
// Se l'utente e' loggato mostra il form per rispondere, altrimenti il pannello di login
if (CurrentUser.isLogged){
FormBuilder.Reset("frm-forum-reply");
Forum.ShowReplyForm();