[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 // 3 // +----------------------------------------------------------------------+ 4 // |zen-cart Open Source E-commerce | 5 // +----------------------------------------------------------------------+ 6 // | Copyright (c) 2003 The zen-cart developers | 7 // | | 8 // | http://www.zen-cart.com/index.php | 9 // | | 10 // | Portions Copyright (c) 2003 osCommerce | 11 // +----------------------------------------------------------------------+ 12 // | This source file is subject to version 2.0 of the GPL license, | 13 // | that is bundled with this package in the file LICENSE, and is | 14 // | available through the world-wide-web at the following url: | 15 // | http://www.zen-cart.com/license/2_0.txt. | 16 // | If you did not receive a copy of the zen-cart license and are unable | 17 // | to obtain it through the world-wide-web, please send a note to | 18 // | license@zen-cart.com so we can mail you a copy immediately. | 19 // +----------------------------------------------------------------------+ 20 // $Id: jscript_main.php 1105 2005-04-04 22:05:35Z birdbrain $ 21 // 22 ?> 23 <script language="javascript" type="text/javascript"><!-- 24 var form = ""; 25 var submitted = false; 26 var error = false; 27 var error_message = ""; 28 29 function check_input(field_name, field_size, message) { 30 if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) { 31 var field_value = form.elements[field_name].value; 32 33 if (field_value == '' || field_value.length < field_size) { 34 error_message = error_message + "* " + message + "\n"; 35 error = true; 36 } 37 } 38 } 39 40 function check_radio(field_name, message) { 41 var isChecked = false; 42 43 if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) { 44 var radio = form.elements[field_name]; 45 46 for (var i=0; i<radio.length; i++) { 47 if (radio[i].checked == true) { 48 isChecked = true; 49 break; 50 } 51 } 52 53 if (isChecked == false) { 54 error_message = error_message + "* " + message + "\n"; 55 error = true; 56 } 57 } 58 } 59 60 61 62 63 64 function checkForm(form_name) { 65 if (submitted == true) { 66 alert("<?php echo JS_ERROR_SUBMITTED; ?>"); 67 return false; 68 } 69 form = form_name; 70 error = false; 71 error_message = "<?php echo JS_ERROR; ?>"; 72 73 74 check_input('review_text',"<?php echo REVIEW_TEXT_MIN_LENGTH; ?>","<?php echo JS_REVIEW_TEXT; ?>"); 75 check_radio("rating","<?php echo JS_REVIEW_RATING; ?>"); 76 77 if (error == true) { 78 alert(error_message); 79 return false; 80 } else { 81 submitted = true; 82 return true; 83 } 84 } 85 86 function popupWindow(url) { 87 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150') 88 } 89 //--></script>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |