amkaos Posted April 13, 2013 Share Posted April 13, 2013 Hi: i have simple form. i use an external javascfipt file to validate required fields.... works fine if user has java turned on. i have an external php file to validate after js .. it has separate error page listing missing fields..and a thank you page that works if form passes validation i really want the php to report missing fields next to the actual boxes like the js does.. this is my jsbin link showing the html , css and js + preview window and how it works.:: http://jsbin.com/osahah/1/edit this is my php file Send_Questions.php ------------------------------- in trying to put errors next to same fields, i changed this working HTML code snip:<div class="input"><input type="text" name="email" id="email" size="30" /><span class="emailError, emailError2"></span><div class="error" id="emailError"><p stlye="float:left"/>Required: Please enter your email address</div>to this:: <div class="input"><input type="text" name="email" id="email" size="30" /><span class="emailError, emailError2"></span><div class="error" id="emailError" value="<?php echo $error_message; ?>"><br><p stlye="float:left"/>Required: Please enter your email address</div>i also tried ::<div class="error" id="emailError" <span>"<?php echo $error_message.='Required: Please enter your email address'; ?></span><br><p stlye="float:left"/>Required: Please enter your email address</div>the first snip is for js validation..it displays errors next to appropriate fields IF user java is turned on.i wanted to keep the js validation and add the php validation using an external php file..of course the php example doesnt work..the $error_message comes from the .php file..am i close?..i have tried moving the tiny php line to other locations,,also i tried with and without the <span> tag..still i get taken to the error page..thanx for lookin i appreciate any help Quote Link to comment https://forums.phpfreaks.com/topic/276915-qform-validation-js-php-report-missing-fields-next-to-actual-field/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.