Click here to Skip to main content
15,891,843 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Angular Js, MongoDB, Javascript Pin
ZurdoDev27-May-15 2:05
professionalZurdoDev27-May-15 2:05 
QuestionDisplay value from database in jvector Map Pin
Member 1127102925-May-15 0:26
professionalMember 1127102925-May-15 0:26 
QuestionHow to read UI element value using jQuery (context vs find) ? Pin
Anjum.Rizwi25-May-15 0:03
professionalAnjum.Rizwi25-May-15 0:03 
AnswerRe: How to read UI element value using jQuery (context vs find) ? Pin
Libin Emmanuel25-May-15 2:07
Libin Emmanuel25-May-15 2:07 
AnswerRe: How to read UI element value using jQuery (context vs find) ? Pin
Richard Deeming27-May-15 2:22
mveRichard Deeming27-May-15 2:22 
QuestionHow to call ajax in php databse file in jvector map? Pin
Member 1127102920-May-15 1:49
professionalMember 1127102920-May-15 1:49 
QuestionRe: How to call ajax in php databse file in jvector map? Pin
ZurdoDev20-May-15 8:56
professionalZurdoDev20-May-15 8:56 
QuestionjQuery validates all required fields except file upload. Pin
samflex19-May-15 8:29
samflex19-May-15 8:29 
I am trying to validate file upload along with a few other form fields.

All the form fields listed in the script below are being validate except the single file upload.

Any ideas what I am doing wrong?

PHP
  <script type='text/javascript' src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.js"></script>
script type='text/javascript'>//<![CDATA[
$(document).ready(function () {
    // We'll use this flag so we don't have to validate fields before
	// the form has been submitted.
	var validatingForm = false;

	// This line before validate() is called allows
	// chosen menus to be validated
	$.validator.setDefaults({ ignore: ":hidden:not(select)" });

    $('#form1').validate({ // initialize the plugin
        invalidHandler: function() {
	        // Now we can validate the fields onChange
	        validateForm = true;
	    },

        rules: {
                   errorElement: 'div',
                    txtBidDate: "required",
                    txtDueDate: "required",
                    BidTitle: "required",
                    BidID: "required",
                    CategoryID: "required",
                    BidIDFile: "required",
                    AliasID: "required",
                    BidContact: "required",
                    ContactEmail: {
                        required: true,
                        email: true
                    },
            BidType: {
                required: true,
            },
                     BidStatus: "required"
        },
                messages: {
                    txtBidDate: "Please enter Issue Date",
                    txtDueDate: "Please enter Due Date",
                    BidTitle: "Please enter Project Title",
                    BidID: "Please enter ID",
                    CategoryID: "Please select a Category",
                    BidIDFile: "Please select a Bid File",
                    AliasID: "Please select Department Alias",
                    BidContact: "Please enter Bid Contact",
                    BidTitle: "Please enter Project Title",

                    BidType: {
                        required: "Please select Bid Type"
                    },
                    ContactEmail: "Please enter a valid email address",
                    BidStatus: "Please select Bid Status"
                },
         });
   //  Now set an onChange event for the chosen menu
   $("CategoryID").change(function(){

       // Check that we've tried to submit the form
       if(validateForm) {
           // We tried to submit the form, re-validate on change...just to get rid of the message
           $("CategoryID").valid();
       }
});
   $("AliasID").change(function(){

       // Check that we've tried to submit the form
       if(validateForm) {
           // We tried to submit the form, re-validate on change...just to get rid of the message
           $("AliasID").valid();
       }
});
   $("BidType").change(function(){

       // Check that we've tried to submit the form
       if(validateForm) {
           // We tried to submit the form, re-validate on change...just to get rid of the message
           $("BidType").valid();
       }
});
   $("BidStatus").change(function(){

       // Check that we've tried to submit the form
       if(validateForm) {
           // We tried to submit the form, re-validate on change...just to get rid of the message
           $("BidStatus").valid();
       }
});
});//]]>

</script>

<input type="file" id="BidIDFile" name="BidIDFile[]" value="" size="50">


Thanks in advance for your prompt assistance.
AnswerRe: jQuery validates all required fields except file upload. Pin
ZurdoDev20-May-15 8:56
professionalZurdoDev20-May-15 8:56 
GeneralRe: jQuery validates all required fields except file upload. Pin
samflex21-May-15 2:40
samflex21-May-15 2:40 
GeneralRe: jQuery validates all required fields except file upload. Pin
Richard Deeming21-May-15 5:51
mveRichard Deeming21-May-15 5:51 
QuestionHow to pass image in javascript? Pin
Shän Yü18-May-15 2:56
Shän Yü18-May-15 2:56 
QuestionRe: How to pass image in javascript? Pin
2Programmer7829-May-15 11:38
2Programmer7829-May-15 11:38 
QuestionBase64 string corrupted or truncated Pin
JeganMaria18-May-15 0:51
JeganMaria18-May-15 0:51 
Questiondesign a game Pin
Member 116724807-May-15 9:17
Member 116724807-May-15 9:17 
AnswerRe: design a game Pin
ZurdoDev7-May-15 9:22
professionalZurdoDev7-May-15 9:22 
Questiondesign a game Pin
Member 116724807-May-15 9:15
Member 116724807-May-15 9:15 
AnswerRe: design a game Pin
ZurdoDev7-May-15 9:23
professionalZurdoDev7-May-15 9:23 
JokeRe: design a game Pin
CodeReady7-May-15 21:32
CodeReady7-May-15 21:32 
GeneralRe: design a game Pin
Sascha Lefèvre31-May-15 10:02
professionalSascha Lefèvre31-May-15 10:02 
GeneralRe: design a game Pin
CodeReady9-Jun-15 20:26
CodeReady9-Jun-15 20:26 
AnswerRe: design a game Pin
Anurag Gandhi31-May-15 2:29
professionalAnurag Gandhi31-May-15 2:29 
QuestionHi friends, How to apply bootstrap classes to the particular selected content from textarea. Pin
Member 113964094-May-15 19:44
Member 113964094-May-15 19:44 
QuestionHow do I secure my access token? Pin
Marc Clifton4-May-15 9:16
mvaMarc Clifton4-May-15 9:16 
GeneralRe: How do I secure my access token? Pin
CodeReady7-May-15 21:31
CodeReady7-May-15 21:31 

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.