Jump to content

dc_jt

Members
  • Posts

    290
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dc_jt's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. dc_jt

    !$_POST

    Sorry, wrong forum. Can someone please move this to PHP Coding??
  2. dc_jt

    !$_POST

    In plain english, if someone enters 0 I dont want if(!$_POST) to pick it up.
  3. dc_jt

    !$_POST

    Hi I have a drop down box which lists months from 0 - 11 and also includes a "Please select..." option which value is set to "". However, when I submit the form with 0, it is not recognised as a value, therefore when I do if($_POST) this is not returned. Is there a way for $_POST to recognise 0 as a value rather than nothing? Hope that makes sense! Thanks
  4. I solved it by adding the following code to the ajax request function: jQuery(".formError").remove(); jQuery("#formID").validationEngine();
  5. Hi I have got a page which contains a form. The form uses jquery inline validation from here: http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ Within my page, I have got a button which uses a jquery function to load a form in from an external page which replaces the current form. However, once this is loaded, the validation stops working! Any idea why? Please see my code below: Original page with form: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title></title> <meta name="description" content=""/> <meta name="Keywords" content=""/> <meta name="robots" content="index"/> <meta name="revisit-after" content="1 days"/> <meta name="author" content=""/> <meta name="copyright" content=""/> <link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" charset="utf-8" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script> <script src="js/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="js/jquery.validationEngine.js" type="text/javascript"></script> <script src="js/postcode-anywhere.js" type="text/javascript"></script> <script> jQuery.noConflict(); jQuery(document).ready(function() { jQuery("#formID").validationEngine() }); function example_ajax_request(divId, url) { jQuery('#'+divId).load(url, "", function(responseText, textStatus, XMLHttpRequest) { if(textStatus == 'error') { jQuery('#'+divId).html('<p>There was an error making the AJAX request</p>'); } } ); } </script> </head> <body> <div id="step2-form"> <form id="formID" name=formID" method="post" action="<?=$_SERVER['PHP_SELF'];?>"> <input type="hidden" id="stage_complete" name="stage_complete" value="2" /> echo "<input name=\"edit\" type=\"button\" value=\"edit\" onclick=\"example_ajax_request('step2-form', 'ajax/updateStep2Form.php?iAddressId=".$oAddress->addressId."&iCustomerId=".$_SESSION['application']->customerId."');\">"; <label for="address1"> <span>Address 1<em>*</em></span> <span> <input name="address1" type="text" class="validate[required,length[0,100]] text-input" id="address1" value="<?=$_POST['address1'] ? $_POST['address1'] : "";?>" /> </span> </label> </form> </div> This is the external page (updateStage2.php): <div id="step2-form"> <form id="formID" name=formID" method="post" action="<?=$_SERVER['PHP_SELF'];?>"> <input type="hidden" id="stage_complete" name="stage_complete" value="2" /> echo "<input name=\"edit\" type=\"button\" value=\"edit\" onclick=\"example_ajax_request('step2-form', 'ajax/updateStep2Form.php?iAddressId=".$oAddress->addressId."&iCustomerId=".$_GET['iCustomerId']."');\">"; <label for="address1"> <span>Address 1<em>*</em></span> <span> <input name="address1" type="text" class="validate[required,length[0,100]] text-input" id="address1" value="<?=$_POST['address1'] ? $_POST['address1'] : "";?>" /> </span> </label> </form> </div> There must be a conflict somewhere because the validation just doesnt work at all once I have loaded in the external page into the <div> called step2-form. Does anyone know why? I have been trying various things for hours! Could it be because of the validationEngine function being called? Any help will be greatly appreciated. Thanks
  6. Hi Does anyone know where I can download open source code to do something similar to the validation on this form? https://carfinance.netcars.co.uk/apply.htm Looking at the source, it looks as though it may be jquery, does anyone know where I can find it? Thanks!
  7. Hi Ive got a form which has a "Years" and a "Months" field where a user enters the number of years and months they have been at their residential address. However, the form must have at least 3 years record of their residential history, therefore they can add multiple addresses. What I need to work out is when they get to the 3 years. To do this, would I turn the years into months i.e 1 = 12, 2 = 24 etc and add this to the number of months? Then work out if this total is equal to or greater than 36 (3 years)? Is this the best way to do it or is there a better alternative? Also, how would I represent this in PHP? Thanks!
  8. Hi I am about to implement a long online application form consisting of 5/6 steps similar to https://www.britishcredittrust.co.uk/apply/ this and need to save the data after each step and can also go back as well as forward through the application. My question is for an opinion really, would I be best saving the data in a session and save them after every step in the database but continue to use the session or should I just save the $_POST data and then if they were to go back to a previous step, retrieve this data from the database and update it when they go forward again? Hope that makes sense. Thanks
  9. Hi I have got a loop with a count starting at 0 and I need to change a class within the loop everytime the count hits 0, 6, 12, 18, 24 etc going up in sixes. I then need one for everytime the count is 7, 13, 19, 25 etc again up in sixes but starting from 7. How would I do this? I was thinking something like: if($count%6==0) for the first one? Not sure about the second though starting at 7? Thanks
  10. Excellent!! Thank you very much.
  11. Nope still havent got it. This is my code: $add1 = "address1"; $add2 = "address2"; $add3 = "address3"; $add4 = "address4"; $add5 = "address5"; $address = array($add1, $add2, $add3, $add4, $add5); $array = array_diff($address, array("")); $add1 = isset($array[0]) ? $array[0] : ""; $add2 = isset($array[1]) ? $array[1] : ""; $add3 = isset($array[2]) ? $array[2] : ""; $add4 = isset($array[3]) ? $array[3] : ""; $add5 = isset($array[4]) ? $array[4] : ""; print_r($array); print("<br />");print("<br />"); print($add1); print("<br />"); print($add2); print("<br />"); print($add3); print("<br />"); print($add4); print("<br />"); print($add5); print("<br />"); Array ( [0] => address1 [3] => address3[4] => address4) address1 address3 address4
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.