Click here to Skip to main content

Web Development

 
Questionopacity issue with ie6 Pinmemberrakeshs3129-May-13 21:03 
AnswerRe: opacity issue with ie6 PinmemberMember 1005025413-May-13 22:40 
GeneralRe: opacity issue with ie6 Pinmemberrakeshs31214-May-13 18:12 
AnswerRe: opacity issue with ie6 PinprofessionalRichard Deeming15-May-13 2:48 
Questionhelp with word wrap please PinmemberJassim Rahma8-May-13 12:08 
AnswerRe: help with word wrap please Pinmember ProgramFOX8-May-13 23:01 
QuestionRe: help with word wrap please PinprofessionalRichard Deeming9-May-13 3:10 
QuestionDatabase Error PinmemberRajib087-May-13 23:56 
Generalhelp for Google +1 button PinmemberGnana Akilan7-May-13 9:54 
GeneralRe: help for Google +1 button PinmvpSandeep Mewara8-May-13 0:03 
Questionnew to programming and need to write a virtual classroom program Pinmemberdowells7-May-13 3:02 
AnswerRe: new to programming and need to write a virtual classroom program PinmvpRichard MacCutchan7-May-13 3:53 
QuestionHow Best to Build Web App to Receive & Post Async Data From Server PinmemberMember 817307430-Apr-13 9:43 
QuestionForm submit error message PinmemberTichaona J29-Apr-13 6:04 
I am trying to get my code to check the “username” field and print an error message letting the user know that they left a field blank. Now before all I had was the below code of which it worked in part, in the sense that the below code was executed when the submit button was clicked on and when the page was refreshed.
 
 
                   if (isset($_POST['username'])) {
                                        
                               emptyField();
                                    
                                         }                           
                                             
                          
                                 function emptyField()
                                    {
                                      $var1 = "*Field missing entry...";
                                     echo $var1;
                                    }
 

 
To fix this I the added the below code, which now meant that the code only worked if the user clicked on the submit button and didn’t work if the page is refreshed. However I’ve also noticed that even when there is text in the “username” field and say the user got there password wrong (not proceeding to the next page), it simply cleared all fields and printed “*Field missing entry...*” Why is this and how do I sort this out…?
 
 

 <?php     
                          
                          
                            if(isset($_POST['submit']))
                                {
                                    fieldChecker();
                                }        
                     
                   
                              function fieldChecker(){ 
                                  
                                    // if the field is empty...
                                    if (isset($_POST['username'])) {
                                        
                                        emptyField();
                                    
                                         }                        
                                  
                              }                  
                          
                                 function emptyField()
                                    {
                                      $var1 = "*Field missing entry...";
                                     echo $var1;
                                    }
                          ?>

AnswerRe: Form submit error message Pinmemberrpprojects16-May-13 17:11 
GeneralRe: Form submit error message PinmemberTichaona J26-May-13 8:37 
GeneralRe: Form submit error message PinmemberDavid Kroj27-May-13 0:54 
Questioncrystal reports not working for visual studio 2010 PinmemberMember 999911226-Apr-13 8:05 
AnswerRe: crystal reports not working for visual studio 2010 PinmvpSandeep Mewara26-Apr-13 8:33 
GeneralRe: crystal reports not working for visual studio 2010 PinmemberMember 999911226-Apr-13 8:35 
QuestionGMail SMTP Outgoing Problem PinmemberIshaan Karnik25-Apr-13 4:58 
AnswerRe: GMail SMTP Outgoing Problem PinprofessionalBernhard Hiller26-Apr-13 1:36 
GeneralRe: GMail SMTP Outgoing Problem PinmemberIshaan Karnik30-Apr-13 4:09 
AnswerRe: GMail SMTP Outgoing Problem PinmvpRichard MacCutchan30-Apr-13 7:29 
QuestionGetting Error while transferring records from one database to other using web application [modified] PinmemberParag Raibagkar22-Apr-13 21:13 
AnswerRe: Getting Error while transferring records from one database to other using web application PinmvpSandeep Mewara22-Apr-13 23:43 
QuestionDisplaying data in chart with import csv file to database sql PinmemberDhimas Yuli PW22-Apr-13 17:34 
AnswerRe: Displaying data in chart with import csv file to database sql PinmemberJasmine250123-Apr-13 9:18 
QuestionHelp trying to set a 12 hour cookie for a DHTML popup PinmemberMember 1000506922-Apr-13 6:36 
QuestionCheckbox check should automatically and slowly fadeout to unchecked PinmemberMember 937599314-Apr-13 8:57 
AnswerRe: Checkbox check should automatically and slowly fadeout to unchecked PinmemberMartin-FFB15-Apr-13 0:32 
AnswerRe: Checkbox check should automatically and slowly fadeout to unchecked PinmemberJasmine250122-Apr-13 12:11 
QuestionWebsite conversion PinmemberOnose13-Apr-13 5:27 
AnswerRe: Website conversion PinmemberMartin-FFB15-Apr-13 0:35 
QuestionHelp with project. JavaScript • CSS • SVG • HTML Pinmembermamouch32013-Apr-13 3:36 
QuestionRails Facebook Login Plug-in keeps timing out PinmemberSimonHerd13-Apr-13 1:48 
Questionhide printer dialog box in javascript PinmemberSumairaR11-Apr-13 2:03 
AnswerRe: hide printer dialog box in javascript Pinmemberdusty_dex11-Apr-13 3:22 
AnswerRe: hide printer dialog box in javascript Pinmembermic2114-May-13 2:38 
Questionlynda.com php-with-mysql-essential-training problem PinmemberTanveer Jony11-Apr-13 1:14 
AnswerRe: lynda.com php-with-mysql-essential-training problem PinmvpRichard MacCutchan11-Apr-13 1:54 
AnswerRe: lynda.com php-with-mysql-essential-training problem Pinmemberenhzflep12-Apr-13 1:39 
QuestionPHP Form fails ... Pinmembercrob0910-Apr-13 15:40 
QuestionStrange one [modified] PinmemberJohn Simmons / outlaw programmer10-Apr-13 14:11 
AnswerRe: Strange one Pinmemberdusty_dex11-Apr-13 1:59 
GeneralRe: Strange one PinmemberJohn Simmons / outlaw programmer11-Apr-13 4:46 
GeneralRe: Strange one Pinmemberdusty_dex11-Apr-13 4:51 
Questionmvc3 razor Pinmemberpooja_verma9-Apr-13 3:11 
AnswerRe: mvc3 razor Pinprofessionalfrazzle-me9-Apr-13 3:57 
QuestionShow a doc or pdf file content in a PHP page PinmemberMember 99294785-Apr-13 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150123.1 | Last Updated 27 Jan 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid