Jump to content

Search the Community

Showing results for tags 'validation'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • The Web Designer Forum Community
    • Web Designer Forum News
    • Web Designer Forum Introductions
    • General Chat
    • Design Competitions
  • Web Design Resource
    • Website Design and Layout
    • Website Reviews and Feedback
    • Other Resources
    • Graphic Design Forum
  • Web Development
    • Frontend
    • Server Side
    • Content Management Systems (CMS)
  • SEO, Website Marketing and Business
    • Social Media
    • Freelancing, Business and Legal Discussion
    • SEO (Search Engine Optimisation) & Search Engines
    • Website Management
  • Software & Hardware
    • Web Browsers
    • Web Design Scripts & Software
    • Web Development Scripts & Software
    • Hardware
  • The Marketplace

Found 14 results

  1. Automated HTML/CSS Validation

    Hello all. I was wondering if there are any tools available that can automate the HTML/CSS validation process. I use the tools available from W3C which are great, but was just wondering if there were any tools that could make it even easier? I've been using a linter for awhile now, which shows errors in code on the fly. I'm not sure if such a tool exists, but if it did someone here would know about it. Thanks
  2. Form Dropdown Check

    Hello, We have a form running which is working well with our clients. It has various drop downs and a captcha script. For just one of the drop downs the boss requires that this must be activated / changed before the form can be submitted. I have looked at various options and tried a number of scripts but none seem to stop the form being submitted. I am happy to share the html code if needed. I would be grateful for some further ideas. Thankyou Regards Neil
  3. I am new to PHP (please be gentle!) and so getting my head around it. I have just created my contact form and the code looks like this <form action="/sendform.php" method="post"> <p>Your name: <input type="text" name="name"></p> <p>Your email: <input type="text" name="email"></p> <p>Your telephone: <input type="text" name="telephone"></p> <p class="nospam">Leave this empty: <input type="text" name="url"></p> <p><textarea name="message"></textarea></p> <p><input type="submit" value="Send"></p> </form> I have created a separate sendform.php file and the code within this looks as follows:- <?php if(isset($_POST['url']) && $_POST['url'] == ''){ $youremail = 'me@example.com'; $body = "This is the form that was just submitted: Name: $_POST[name] E-Mail: $_POST[email] Message: $_POST[message]"; if( $_POST['email'] && !preg_match( "/[\r\n]/", $_POST['email']) ) { $headers = "From: $_POST[email]"; } else { $headers = "From: $youremail"; } mail($youremail, 'Contact Form', $body, $headers ); } header('Location: http://www.example.com/thanks/'); ?> So the first line of code (if I have got this correct) I am tryint to tell the form not to send the form to me, if the url field is filled in [as this is intended as a hidden field]. Further down I added the [!preg_match] to help protect the script from email injection. I have heard this is the correct way to do this? Is this form okay as it stands? And in terms of validation, is there a simple piece of code I can add somewhere within this script to ensure that the user fills in all the required fields ie Name, Email, Telephone & Message? Thanks so much for any help and advice on this.. I have been researching for days!
  4. I was wondering what the general consensus was on css code, I agree that validating HTML the correct tools (eg. http://validator.w3.org/) is pretty essential, but I was wondering if it is essential to do the same with css? Are the constraints too narrow or is it good to use a tool (eg. https://jigsaw.w3.org/css-validator/) to validate css? For example, if it comes up with the error - Property webkit-box-shadow doesn't exist, should I delete the code? Over to you..
  5. Validation Function Issue (js)

    Hi Gang, Now js is not my strong point but i'm trying to pretty up a form. I've hit a bug I cannot work out. The problem is that it sort of works. On submit with all blank but a file in the img_ext and img_int fields the form it returns false and highlights fine. If you complete just name, email or phone combination of two and files in the file fields it validates fine and prevents upload. The weird bit is if you complete all but the model field it proceeds to upload regardless that the model field is blank. Any ideas? The form ... <form name="valreq" action="" method="post" class="form" id="req" enctype="multipart/form-data"> <h2 class="yk hblock"><span class="name" itemprop="name">Your Details</span></h2> <div id="enqDets"></div> <fieldset> <ul class="table fs-1"> <li><label for="name">Name:</label><div><input name="name" id="name" type="text" class="input" value=""></div></li> <li><label for="email">Email:</label><div><input name="email" id="email" type="text" class="input" value=""></div></li> <li><label for="phone">Phone:</label><div><input name="phone" id="phone" type="text" class="input" value=""></div></li> </ul> </fieldset> <div class="clear8"></div> <h2 class="yk hblock"><span class="name" itemprop="name">Vehicle Details</span></h2> <div id="campDets"></div> <fieldset> <ul class="table fs-1"> <li><label for="model">Make & Model:</label><div><input name="model" id="model" type="text" class="input" value=""></div></li> </ul> </fieldset> <fieldset> <ul class="table fs-1"> <li><label for="img_ext">Exterior Image:</label><div><input name="imgs[]" id="img_ext" type="file" style="background: #fff;" class="input"></div></li> <li><label for="img_int">Interior Image:</label><div><input name="imgs[]" id="img_int" type="file" style="background: #fff;" class="input"></div></li> </ul> </fieldset> <div class="center liner"><input name="submit" type="submit" class="submit yk fs2" value="Send"></div> </form> The validation ... $(document.forms['valreq']).submit(sellvalidate); function sellvalidate() { $("body").find('#loader').show(); var enqForm = document.forms['valreq']; $('#enqDets').removeClass('errMsg').removeClass('liner').html(''); $('#campDets').removeClass('errMsg').removeClass('liner').html(''); $('#campSec').removeClass('errMsg').removeClass('liner').html(''); $(enqForm).find('input, label, select, div').removeClass('errbox'); if(enqForm.name.value=="") { $(enqForm.name).parent('div').addClass('errbox'); $(enqForm.name).parent('div').prev('label').addClass('errbox'); $(enqForm.name).focus(); $('#enqDets').addClass('errMsg').addClass('liner').html('Please provide your name.'); $("html, body").animate({ scrollTop: $('#enqDets').offset().top - 20 }, 1000); $("body").find('#loader').hide(); return false; }; if(enqForm.email.value=="") { $(enqForm.email).parent('div').addClass('errbox'); $(enqForm.email).parent('div').prev('label').addClass('errbox'); $(enqForm.email).focus(); $('#enqDets').addClass('errMsg').addClass('liner').html('Please provide your email.'); $("html, body").animate({ scrollTop: $('#enqDets').offset().top - 20 }, 1000); $("body").find('#loader').hide(); return false; } else { var emt = $(enqForm.email).val(); email_regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i; if(!email_regex.test(emt)){ $(enqForm.email).parent('div').addClass('errbox'); $(enqForm.email).parent('div').prev('label').addClass('errbox'); $(enqForm.email).focus(); $('#enqDets').addClass('errMsg').addClass('liner').html('Please provide a valid email address.'); $("html, body").animate({ scrollTop: $('#enqDets').offset().top - 20 }, 1000); $("body").find('#loader').hide(); return false; } }; if(enqForm.phone.value=="") { $(enqForm.phone).parent('div').addClass('errbox'); $(enqForm.phone).parent('div').prev('label').addClass('errbox'); $(enqForm.phone).focus(); $('#enqDets').addClass('errMsg').addClass('liner').html('Please provide your phone number.'); $("html, body").animate({ scrollTop: $('#enqDets').offset().top - 20 }, 1000); $("body").find('#loader').hide(); return false; } else { var phone = $(enqForm.phone).val(); intRegex = '/[0-9 -()+]+$/'; if((phone.length < 6) || (!intRegex.test(phone))) { $(enqForm.phone).parent('div').addClass('errbox'); $(enqForm.phone).parent('div').prev('label').addClass('errbox'); $(enqForm.phone).focus(); $('#enqDets').addClass('errMsg').addClass('liner').html('Please provide a valid phone number.'); $("html, body").animate({ scrollTop: $('#enqDets').offset().top - 20 }, 1000); $("body").find('#loader').hide(); return false; } }; if(enqForm.model.value=="") { $(enqForm.model).parent('div').addClass('errbox'); $(enqForm.model).parent('div').prev('label').addClass('errbox'); $(enqForm.model).focus(); $('#campDets').addClass('errMsg').addClass('liner').html('Please provide the vehicle make and model.'); $("html, body").animate({ scrollTop: $('#campDets').offset().top - 20 }, 1000); $("body").find('#loader').hide(); return false; }; }
  6. Hey everyone, I'm having way too much trouble getting a single answer validation check to work for some check boxes on a client project. I'm using jQuery validator: http://formvalidator.net/#default-validators The radio buttons validate whether you press a button or not! I made a test to make sure that the code worked and it did, so I implemented it into the main project file and it validates regardless of whether or not it's received any feedback. I can't for the life of me work out why because the code is the same: Here's the jsfiddle: http://jsfiddle.net/3vwWL/1/ I've marked the HTML location where the problem html is, the JS runs the validation.
  7. Form validation issue

    Trying to add a simple bit of validation to my contact form and it seems to not be checking the field. Anyone mind pointing out why that is? (It's a simple 2 + 2 at the moment). contact.php <?php error_reporting(E_ALL ^ E_NOTICE); // hide all basic notices from PHP //If the form is submitted if(isset($_POST['submitted'])) { // require a name from user if(trim($_POST['contactName']) === '') { $nameError = 'Forgot your name!'; $hasError = true; } else { $name = trim($_POST['contactName']); } // need valid email if(trim($_POST['email']) === '') { $emailError = 'Forgot to enter in your e-mail address.'; $hasError = true; } else if (!preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i", trim($_POST['email']))) { $emailError = 'You entered an invalid email address.'; $hasError = true; } else { $email = trim($_POST['email']); } // we need at least some content if(trim($_POST['comments']) === '') { $commentError = 'You forgot to enter a message!'; $hasError = true; } else { if(function_exists('stripslashes')) { $comments = stripslashes(trim($_POST['comments'])); } else { $comments = trim($_POST['comments']); } } // we need at least some content if(trim($_POST['comments']) === '') { $commentError = 'You forgot to enter a message!'; $hasError = true; } else { if(function_exists('stripslashes')) { $comments = stripslashes(trim($_POST['comments'])); } else { $comments = trim($_POST['comments']); } } // THIS SECTION if(isset($_POST['validation']) && $_POST['validation'] == 4){ $validationError = 'Please enter a number!'; $validationError = true; } else { $validation = trim($_POST['validation']); } // END SECTION // upon no failure errors let's email now! if(!isset($hasError)) { $emailTo = 'email@email.com'; $subject = "$name"; $sendCopy = trim($_POST['sendCopy']); $body = "Name: $name \n\nEmail: $email \n\nComments: $comments"; $headers = 'From: ' .' <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email; mail($emailTo, $subject, $body, $headers); // set our boolean completion value to TRUE $emailSent = true; } } ?> Form <?php if(isset($emailSent) && $emailSent == true) { ?> <p class="info">Your email was sent.</p> <?php } else { ?> <div id="contact-form"> <?php if(isset($hasError) || isset($captchaError) ) { ?> <p class="alert">Error submitting the form</p> <?php } ?> <form id="contact-us" action="index.php" method="post"> <div class="formblock"> <input type="text" name="contactName" id="contactName" value="<?php if(isset($_POST['contactName'])) echo $_POST['contactName'];?>" class="txt requiredField" placeholder="Name" /> <?php if($nameError != '') { ?> <br /> <span class="error"><?php echo $nameError;?></span> <?php } ?> </div> <div class="formblock"> <input type="text" name="email" id="email" value="<?php if(isset($_POST['email'])) echo $_POST['email'];?>" class="txt requiredField email" placeholder="Email" /> <?php if($emailError != '') { ?> <br /> <span class="error"><?php echo $emailError;?></span> <?php } ?> </div> <div class="formblock"> <textarea name="comments" id="commentsText" class="txtarea requiredField" placeholder="Message"><?php if(isset($_POST['comments'])) { if(function_exists('stripslashes')) { echo stripslashes($_POST['comments']); } else { echo $_POST['comments']; } } ?> </textarea> <?php if($commentError != '') { ?> <br /> <span class="error"><?php echo $commentError;?></span> <?php } ?> </div> <div class="formblock"> <input type="text" name="validation" id="validation" value="<?php if(isset($_POST['validation'])) echo $_POST['validation'];?>" class="txt requiredField validation" placeholder="2 + 2" /> <?php if($validationError != '') { ?> <br /> <span class="error"><?php echo $validationError;?></span> <?php } ?> </div> <button name="submit" type="submit" class="subbutton">Send us Mail!</button> <input type="hidden" name="submitted" id="submitted" value="true" /> </form> </div> <?php } ?> Thanks for any help (:
  8. Text Validation

    I know that I should be trying to contribute more but I was just wondering if someone could help me know why I am not able validate data correctly. Basically what's happening is that it's validated the input before I've actually entered any type of data, how do I remove that style effect: http://jsfiddle.net/xepDX/
  9. Good day Folks, Hope all is well, I just wanted to kindly ask you to review our new website and let us know what you think before our official go live date next Monday. WeSellSSL, Be Secured, Stay Assured! Irish SSL Certificate provider Any feedback is appreciated! Thank you, William
  10. Hello, Looking for some guidance. The contact form that I have created, I implemented new fields, but they do not show up in the email. hoping someone could help out. The LIST/Menu and the Radio buttons I have do not show up. much thanks.
  11. Hi Guys, I am wondering if anybody knows any good tutorials for creating a php contact form with validation and spam protection? On searching the internet I can find tutorials on contact forms etc. but nobody seems to have posted a full tutorial on how to make a fully functioning, safe contact form. I know you can use CAPTCHA to protect from spammers but the form I am currently creating is to request a call-back on the home page of a website. It is only a small form in the footer of the website and obviously I don't want to have to have a big captcha image below it. Is there anyway of protecting from spam with php code? I am fairly new to php so a tutorial would be great as I am wanting to learn more. Any help is greatly appreciated.
  12. My experience with WordPress is that I'm always receiving numerous validation errors when using a plugin, existing theme or sometimes just down to feeds. The quick solution would be to do everything from scratch but time dictates a bit as well as budgets. The question I'd like to ask my fellow WDF buddies is this: how important is validation to you? For me it's a no-brainer and I'd like to get everything to validate (not fussed about warnings - as long as I understand what they mean). HTML takes priority for me. Ideally I get CSS as up to speed as possible, but it's not always realistic. Just wondering whether I should abandon ship, admit defeat and let a site skip validation or not.
  13. Hi all, It's been a while since I've been on here and I'm sure things have changed a lot. Hopefully some of the old warriors are still on here. Hope everyone is good. Anyway enough of the small talk here's my deal; I have a task set for me which is non-changeable. No- I cannot use CSS3. Yes- it has to validate to XHTML 1.0 & CSS 2.1! I have produced Thumbnails, Sketches, Lo Fi Wireframes, Hi Fi Wireframes and of course the Screen Designs. The next step of course is for me to build the site however there are some tight restrictions which clash with the build ability of my site as mentioned above. I am using a white rectangular box with 6px round edges with a 4px outer glow on each edge for the content areas. The issues which are causing me problems when validating are: The way I produce the round edges with CSS The drop shadow/outer glow effect with CSS on these boxes So I've come up with a solution of slicing the Screen Design up into multiple images in Photoshop, saving these images to web to keep the file size down and setting as the background image for each relating div. It's worked and validated, but what I want to know is- Is there any other way of achieving this given my boundaries? And/or will this method cause me any problems..? Regards, Craig
  14. Hello. What would you say i should do when i get the following message 8 times when validating my index.html (using the w3c validator): Bad value lightbox[a] for attribute rel on element a: Keyword lightbox[a] is not registered. If i delete that code from my site Then the lightbox dont work. Thanks for your help.
×