-
Posts
960 -
Joined
-
Last visited
Everything posted by Destramic
-
anyone know how to get it working?
-
i found this align label script which should align your form fields in a straigh flushed column...i'm very new to this jquery...does anyone know of a way to get this working or maybe a better tutorial/script thank you <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>align form</title> <style type="text/css"> </style> <script type="text/javascript"> jQuery.fn.autoWidth = function(options) { var settings = { limitWidth : false } if(options) { jQuery.extend(settings, options); }; var maxWidth = 0; this.each(function(){ if ($(this).width() > maxWidth){ if(settings.limitWidth && maxWidth >= settings.limitWidth) { maxWidth = settings.limitWidth; } else { maxWidth = $(this).width(); } } }); this.width(maxWidth); } $('label').autoWidth({limitWidth: 350}); </script> </head> <body> <label for="a_field">name :</label> <input id="a_field" name="a_field" type="text" /> <br/> <label for="a_field">e-mail address :</label> <input id="a_field" name="a_field" type="text" /><br/> <label for="a_field">number :</label> <input id="a_field" name="a_field" type="text" /> <br/> <label for="a_field">postcode :</label> <input id="a_field" name="a_field" type="text" /> <br/> <button id="btnNothingToDo">Do nothing</button> </body> </html>
-
still n luck...ive been trying for hours...im pickled haha
-
it is still coming back with the same error sorry on this line; $("#datepicker").datepicker();
-
sorry...here is the page im trying to get it to work on if that helps...but thats the only error im getting <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="/css/style.css" /> <link rel="stylesheet" type="text/css" href="/ajax/jquery/datepicker/datepicker.css" /> <script type="text/javascript" src="ajax/jquery/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="ajax/jquery/datepicker/datepicker.js"></script> <script type="text/javascript" src="ajax/jquery/datepicker/datepicker.core.js"></script> <script type="text/javascript" src="/javascript/inputEmbeddedImage.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".inputWithImage").each(function(){ $(this).add($(this).next()).wrapAll('<div class="imageInputWrapper"></div>'); }); }); $(function() { $("#datepicker").datepicker(); }); </script> </head> <title></title> <body> <div id="addLeague"> <form action="" name="test" method="POST"> <label for ="start_date">Start Date:</label> <input name="start_date" type="text" class="inputWithImage" title="" id="datepicker" /> <img src="C:/www/images/calendar.png" alt="Calandar" onclick="alert('Popup some calendar here!');" /><br /> <input type="submit" value="Add League" title="Submit Form" /> <input type="reset" value="Reset" title="Reset Form" /> </form> </div> <br />
-
its a jquery that pops a calender from a input field this might explain better http://marcgrabanski.com/pages/code/jquery-ui-datepicker
-
im trying to set this Date Picker script on my form page but its coming back with an error saying "object does not support this property or method" on this code <script>$(function() { $("#datepicker").datepicker(); }); </script> although the jquery/javascript files as included correctly its coming back with an error...does anyone know how i can fix this please?...thank you
-
hey...i've just made a table that looks like this called COUNTRYS counrty_id continent country_name ------------------------------------------------------- 1 Europe United Kingdom 2 Europe Netherlands 3 Asia Thailand -------------------------------------------------------- now i know this is possible but i was to display the results like this if anyone can help plese Europe- United Kingdom Nethlands Asia- Thailand thanks
-
im writing a form validation script and have come across a small problem. the problem im having is when set my own error message: $Form->Required_Field("name", "text", "please eneter your name)"); then after viewing the form and entering an email it will show up with 2 errors for the name field...if anyone can help please form_Validation.php <?php define("FORM_ERROR_REQUIRED_VALUE", "%s : Please enter a %s"); define("FORM_ERROR_REQUIRED_EMAIL", "%s : Please enter a valid E-mail Address. Format - name@example.co.uk."); class Form_Validation { public $Fields = array(); public $Error_Messages = array(); public $Errors = false; public function Required_Field($field_name, $field_type, $error_message = NULL) { $this->Fields[$field_name]['name'] = $field_name; $this->Fields[$field_name]['type'] = $field_type; $this->Fields[$field_name]['error_message'] = $error_message; } public function Validate_Form() { foreach ($this->Fields as $field) { $field_name = $field['name']; $field_type = $field['type']; $error_message = $field['error_message']; $field_value = $_POST[$field_name]; switch ($field_type) { case "text": if (empty($field_value)) { $default_error_message = sprintf(FORM_ERROR_REQUIRED_VALUE, $field_name, $field_name); } break; case "email": if (!$this->Email_Validation($field_value)) { $default_error_message = sprintf(FORM_ERROR_REQUIRED_EMAIL, $field_name); } break; } if ($error_message && $default_error_message) { $this->Set_Error_Message($error_message); } else { $this->Set_Error_Message($default_error_message); } } } public function Display_Errors() { foreach ($this->Error_Messages as $errors) { echo $errors . "<br />\n"; } } public function Set_Error_Message($error_message) { if (!in_array($error_message, $this->Error_Messages)) { $this->Error_Messages[]= $error_message; } } public function Email_Validation($email) { return eregi("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$", $email); } } ?> form.php <?php require_once $_SERVER['DOCUMENT_ROOT'] . "\classes\Form_Validation.php"; $Form = new Form_Validation; $Form->Required_Field("name", "text", "please eneter your name)"); $Form->Required_Field("email", "email"); $Form->Validate_Form(); $Form->Display_Errors(); echo <<<HTML <form action="{$_SERVER['REQUEST_URI']}" name="test" method="POST"> <fieldset> <legend>Add League</legend> name: <input type="text" name="name" title="name"/><br /> email : <input type="text" name="email" title="email" /><br /> <input type="submit" value="Add League" title="Submit Form" /> <input type="reset" value="Reset" title="Reset Form" /> </fieldset> </form> HTML; ?>
-
well thank you anyways so to have wasted your time...back to the drawing board
-
heres the two pages if you can help please Form_Validation.php <?php class Form_Validation { public $Form_Name; public $Fields = array(); public $Method = "POST"; public $Errors = false; public function __construct($form_name) { $this->Form_Name = $form_name; } public function Validate_Field($field_name, $field_type, $error_message) { $this->Fields[$field_name]['name'] = $field_name; $this->Fields[$field_name]['type'] = $field_type; $this->Fields[$field_name]['error_message'] = $error_message; } public function Display_Errors() { foreach ($this->Fields as $field) { $field_name = $field['name']; $field_type = $field['type']; $error_message = $field['error_message']; echo $field_value = ${"_" . $this->Method}[$field_name]; } } public function Validate_Form() { } } ?> Form.php <?php require_once $_SERVER['DOCUMENT_ROOT'] . "Form_Validation.php"; $Form = new Form_Validation("test"); $Form->Validate_Field("name", "text", "Please "); $Form->Display_Errors(); echo <<<HTML <form action="{$_SERVER['REQUEST_URI']}" name="test" method="POST"> <fieldset> <legend>Add League</legend> <label for="name">League Name:</label> <input type="text" name="name" title="League Name"/><br /> <input type="submit" value="Add League" title="Submit Form" /> <input type="reset" value="Reset" title="Reset Form" /> </fieldset> </form> HTML; ?>
-
this is strange...its not working...maybe something to do with my setting with php/apache? which may be stopping it from working?
-
it all works but this part doesn't $field_value = ${"_" . $this->Method}[$field_name];
-
yep POST is the value set for the method...but has no return here is my code...but i am running this script off my apache server...possible some setting are wrong in my php.ini file? <?php class Form_Validation { public $Form_Name; public $Fields = array(); public $Method = "POST"; public $Errors = false; public function __construct($form_name) { $this->Form_Name = $form_name; } public function Validate_Field($field_name, $field_type, $error_message) { $this->Fields[$field_name]['name'] = $field_name; $this->Fields[$field_name]['type'] = $field_type; $this->Fields[$field_name]['error_message'] = $error_message; } public function Display_Errors() { foreach ($this->Fields as $field) { $field_name = $field['name']; $field_type = $field['type']; $error_message = $field['error_message']; echo $field_value = ${"_" . $this->Method}[$field_name]; echo $_POST[$field_name]; echo $this->Method; } } public function Validate_Form() { } } ?>
-
i tried the code and it returned no value <?php echo $field_value = ${"_" . $this->Method}[$field_name]; // but both vars below returned values echo $_POST[$field_name]; echo $this->Method; ?> so the code you gave me didn't seem to have worked
-
as the method can change from _POST - _GET variable varable is what i need for this certian code...do you know why the code above isn't working please?
-
i'm having a problem getting this to work... $this->method = "POST" if anyone could help please $field_value = $_{$this->Method}[$field_name];
-
thats a great help...thank again
-
i've just trying to get back into php after a long break...and im a bit rusty on a few certian things...and i can't get this code to work below if anyone can hep me please cause i've forgtten how to use <<<CODE to echo the html <?php <<<CODE <form action="<?php echo __FILE__; ?>" name="test"> Name : <input type="text" name="name" /><br /> E-Mail : <input type="text" name="email" /><br /> </form> >>>CODE; ?>
-
hey guys...a nice and easy question, does anyone have a script or a tutorial to help take card payments over the net...all im after is a simple script which you can input your card details and it debits a one off payment to another account...if somone could point me in the right direction i'd be very greatful...thanks