Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderators: ArturoRobles, ArturoRobles

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By manalidhuri
#826804
I want to display alert message using javascript, if input document is not uploaded in dynaform.
Is there any solution?

Thanks
User avatar
By programerboy
#826826
Hi,
If you checked the required checkbox of the multipleFile, the form check empty files automatically
But if you want check it with JavaScript a simple code is like this:
Code: Select all
function check_form(){
	var uploadedFiles = [];
	var uploadedFilesCount = $("input[name^='form[multipleFileVar005]']").length/3;
	for(var i=0;i<uploadedFilesCount;i++){
		if(document.getElementsByName('form[multipleFileVar005]['+i+'][appDocUid]').length > 0){
			var temp = [];
			temp[temp.length] = document.getElementsByName('form[multipleFileVar005]['+i+'][appDocUid]')[0].value;
			temp[temp.length] = document.getElementsByName('form[multipleFileVar005]['+i+'][name]')[0].value;
			temp[temp.length] = document.getElementsByName('form[multipleFileVar005]['+i+'][version]')[0].value;
			uploadedFiles.push(temp);
		}
		else
			break;
	}
	
	if(uploadedFiles.length == 0){
		alert('You must upload at least 1 file');
		return;
	}
	else if(uploadedFiles.length > 2){
		alert('You must upload maximum 2 files.');
		return;
	}
}
https://www.youtube.com/channel/UCYiyz1 ... jMXodwH1iw
Thanks
Last edited by programerboy on Sun Nov 24, 2019 4:28 am, edited 1 time in total.
Dynamic minDate

Hi, I need to reset minDate attribute. if a dropdo[…]

Tickets cerrados

I have been facing the same https://bigbucket.co/p[…]

This situation is indeed not handled. The general […]

Accounting Writing Services

Accounting Coursework Writing Services are hard to[…]