Click here to Skip to main content
12,698,048 members (22,975 online)

Web Development

 
QuestionRe: help with word wrap please Pin
Richard Deeming9-May-13 3:10
professionalRichard Deeming9-May-13 3:10 
QuestionDatabase Error Pin
Rajib087-May-13 23:56
memberRajib087-May-13 23:56 
Generalhelp for Google +1 button Pin
Gnana Akilan7-May-13 9:54
memberGnana Akilan7-May-13 9:54 
GeneralRe: help for Google +1 button Pin
Sandeep Mewara8-May-13 0:03
mvpSandeep Mewara8-May-13 0:03 
Questionnew to programming and need to write a virtual classroom program Pin
dowells7-May-13 3:02
memberdowells7-May-13 3:02 
AnswerRe: new to programming and need to write a virtual classroom program Pin
Richard MacCutchan7-May-13 3:53
mvpRichard MacCutchan7-May-13 3:53 
QuestionHow Best to Build Web App to Receive & Post Async Data From Server Pin
Member 817307430-Apr-13 9:43
memberMember 817307430-Apr-13 9:43 
QuestionForm submit error message Pin
Tichaona J29-Apr-13 6:04
memberTichaona 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 Pin
rpprojects16-May-13 17:11
memberrpprojects16-May-13 17:11 
GeneralRe: Form submit error message Pin
Tichaona J26-May-13 8:37
memberTichaona J26-May-13 8:37 
GeneralRe: Form submit error message Pin
David Kroj27-May-13 0:54
memberDavid Kroj27-May-13 0:54 
Questioncrystal reports not working for visual studio 2010 Pin
Member 999911226-Apr-13 8:05
memberMember 999911226-Apr-13 8:05 
AnswerRe: crystal reports not working for visual studio 2010 Pin
Sandeep Mewara26-Apr-13 8:33
mvpSandeep Mewara26-Apr-13 8:33 
GeneralRe: crystal reports not working for visual studio 2010 Pin
Member 999911226-Apr-13 8:35
memberMember 999911226-Apr-13 8:35 
QuestionGMail SMTP Outgoing Problem Pin
Ishaan Karnik25-Apr-13 4:58
memberIshaan Karnik25-Apr-13 4:58 
AnswerRe: GMail SMTP Outgoing Problem Pin
Bernhard Hiller26-Apr-13 1:36
professionalBernhard Hiller26-Apr-13 1:36 
GeneralRe: GMail SMTP Outgoing Problem Pin
Ishaan Karnik30-Apr-13 4:09
memberIshaan Karnik30-Apr-13 4:09 
AnswerRe: GMail SMTP Outgoing Problem Pin
Richard MacCutchan30-Apr-13 7:29
mvpRichard MacCutchan30-Apr-13 7:29 
QuestionGetting Error while transferring records from one database to other using web application Pin
Parag Raibagkar22-Apr-13 21:13
memberParag Raibagkar22-Apr-13 21:13 
AnswerRe: Getting Error while transferring records from one database to other using web application Pin
Sandeep Mewara22-Apr-13 23:43
mvpSandeep Mewara22-Apr-13 23:43 
QuestionDisplaying data in chart with import csv file to database sql Pin
Dhimas Yuli PW22-Apr-13 17:34
memberDhimas Yuli PW22-Apr-13 17:34 
AnswerRe: Displaying data in chart with import csv file to database sql Pin
Jasmine250123-Apr-13 9:18
memberJasmine250123-Apr-13 9:18 
QuestionHelp trying to set a 12 hour cookie for a DHTML popup Pin
Member 1000506922-Apr-13 6:36
memberMember 1000506922-Apr-13 6:36 
QuestionCheckbox check should automatically and slowly fadeout to unchecked Pin
Member 937599314-Apr-13 8:57
memberMember 937599314-Apr-13 8:57 
AnswerRe: Checkbox check should automatically and slowly fadeout to unchecked Pin
Martin-FFB15-Apr-13 0:32
memberMartin-FFB15-Apr-13 0:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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.170118.1 | Last Updated 20 Jan 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid