|
|

|
|

|

|
© 2008 JOKRIS.INFO - Strefa Polskich Składników Joomla! i Mambo |
|
Najnowsze Pliki Dodane Do ReMOSitory |
|
|
|
|
|
Najnowsze wątki na Forum Jokris.info |
|
|
|
|
|
Odliczamy do... |
|
|
|
|
|
Forum Joomla / Mambo :: JOKRIS.INFO - Strefa Polskich Składników Joomla! i Mambo
[PHP] Sprawdzanie pola formularza (1 wejść)
|
|
TEMAT: [PHP] Sprawdzanie pola formularza
|
szymanek1991 (Użytkownik)
Zaglądający
Posty: 11
|
| [PHP] Sprawdzanie pola formularza 2007/11/01 22:30 |
Oklaski: -1   |
Witajcie! Tak się składa, że dane mi jest postawić sklep internetowy na komponencie Virtuemart do mambo. Problem w tym, że mamy tutaj formularz rejestracyjny, w którym jest feralne pole, w którym należy wybrać Kraj. Pole to jest mi kompletnie niepotrzebne do szczęścia, a kiedy je wyrzucę, to nie da się niestety zarejestrować, bo moduł sprawdzający poprawność formularza pokazuje, że pole nie zostało wypełnione. Poniżej przedstawię kod, a Was proszę o wyjaśnienie jak usunąć to pole w taki sposób, by rejestracja była możliwa. | Kod: | <?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/**
*
* @version $Id: checkout_register_form.php,v 1.13.2.3 2006/04/05 18:16:54 soeren_nb Exp $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2005 Soeren Eberhardt. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName( __FILE__ );
$missing = mosGetParam( $_REQUEST, "missing", "" );
$missing_style = "color:red; font-weight:bold;";
if (!empty( $missing )) {
echo "<script type=\"text/javascript\">alert('"._CONTACT_FORM_NC."'); </script>\n";
}
$label_div_style = 'float:left;width:30%;text-align:right;vertical-align:bottom;font-weight: bold;padding-right: 5px;';
$field_div_style = 'float:left;width:60%;';
/**
* This section will be changed in future releases of VirtueMart,
* when we have a registration form manager
*/
$required_fields = Array( 'company', 'first_name', 'last_name', 'middle_name', 'address_1', 'address_2', 'city', 'country', 'zip', 'phone_1', 'phone_2', 'fax' ); (tutaj kasuję wpis 'country], żeby to pole nie było jako wymagane)
$shopper_fields = array();
// This is a list of all fields in the form
// They are structured into fieldset
// where the begin of the fieldset is marked by
// an index called uniqid('fieldset_begin')
// and the end uniqid('fieldset_end')
if (!$my->id && VM_SILENT_REGISTRATION != '1' ) {
// These are the fields for registering a completely new user!
// Create a new fieldset
$shopper_fields[uniqid('fieldset_begin')] = $VM_LANG->_PHPSHOP_ORDER_PRINT_CUST_INFO_LBL;
$shopper_fields['username'] = _REGISTER_UNAME;
$shopper_fields['email'] = _REGISTER_EMAIL;
$shopper_fields['password'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_PASSWORD_1;
$shopper_fields['password2'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_PASSWORD_2;
// Finish the fieldset
$shopper_fields[uniqid('fieldset_end')] = "";
// Add the new required fields into the existing array of required fields
$required_fields = array_merge( $required_fields, Array( 'email', 'username','password','password2') );
}
// Now the fields for customer information...Bill To !
$shopper_fields[uniqid('fieldset_begin')] = $VM_LANG->_PHPSHOP_USER_FORM_BILLTO_LBL;
$shopper_fields['company'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_COMPANY_NAME;
$shopper_fields['first_name'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_FIRST_NAME;
$shopper_fields['last_name'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_LAST_NAME;
$shopper_fields['middle_name'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_MIDDLE_NAME;
$shopper_fields['address_1'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_ADDRESS_1;
$shopper_fields['address_2'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_ADDRESS_2;
$shopper_fields['city'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_CITY;
$shopper_fields['zip'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_ZIP;
$shopper_fields['country'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_COUNTRY; (tą linijkę usuwam, żeby pole się nie wyświetlało)
if (CAN_SELECT_STATES == '1') {
$shopper_fields['state'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_STATE;
$required_fields[] = 'state';
}
$shopper_fields['phone_1'] = $VM_LANG->_PHPSHOP_SHOPPER_FORM_PHONE;
$shopper_f
|
| | | | | | |