15,904,024 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by huotari (Top 18 by date)
huotari
4-Oct-12 5:17am
View
and don't place these $.validator.addMethod and $.validator.unobtrusive.adapters.addBool inside document ready
huotari
4-Oct-12 5:15am
View
oops replace if(numOfEmptyInputs > 0) with if(numOfEmptyInputs > 1)
huotari
4-Oct-12 5:14am
View
But like i said this code just validates the last input or select. Try the following:
$.validator.addMethod('multiplerequiredvalues', function (value, element) {
if ($(element).is(':visible')) {
var name = $(element).attr('name');
var elements;
if ($(element).is('input')) {
elements = $('input[name=' + name + ']');
}
else {
elements = $('select[name=' + name + ']');
}
var numOfEmptyInputs = 0;
elements.each(function () {
if ($(this).is(':visible') && !$(this).val()) {
numOfEmptyInputs++;
}
});
if(numOfEmptyInputs > 0)
return true;
else
return false;
}
else {
return true;
}
});
$.validator.unobtrusive.adapters.addBool("multiplerequiredvalues");
huotari
3-Oct-12 10:26am
View
I think this piece of code just validates the last input or select, if it has a value then validation passes. Also from all the examples i have seen, this should not be inside document ready.
(function ($) {
$.validator.addMethod('multiplerequiredvalues', function (value, element) {
if ($(element).is(':visible')) {
var returnVal = true;
var name = $(element).attr('name');
var elements;
if ($(element).is('input')) {
elements = $('input[name=' + name + ']');
}
else {
elements = $('select[name=' + name + ']');
}
elements.each(function () {
if ($(this).is(':visible')) {
returnVal = $(this).val() != "" && $(this).val() != null;
}
});
return returnVal;
}
else {
return true;
}
});
$.validator.unobtrusive.adapters.addBool("multiplerequiredvalues");
} (jQuery));
huotari
3-Oct-12 8:44am
View
So during the first load you cant see this pages scripts at all?
huotari
3-Oct-12 8:23am
View
Well you can check it by looking at the page source and clicking on the script url. If you get a 404 content not found then it is not loaded.
huotari
3-Oct-12 8:06am
View
Have you checked that during the first load the scripts are actually loaded
huotari
3-Oct-12 5:30am
View
To clarify you are not using a server as source for the autocomplete, you have all these options somewhere on the page or in javascript
huotari
3-Oct-12 5:20am
View
Thank you for relying, but it didn't work. I get the following exception:
3.10.2012 12:14:38 [com.sun.xml.ws.policy.jaxws.PolicyConfigParser] parse
INFO: WSP5018: Loaded WSIT configuration from file: "path"/build/classes/META-INF/wsit-client.xml.
3.10.2012 12:14:39 com.sun.xml.wss.impl.misc.DefaultCallbackHandler handleUsernameCallback
SEVERE: WSS1500: Username Handler Not Configured properly using Callback and is null. (not cofigured)
3.10.2012 12:14:39 com.sun.xml.wss.impl.misc.DefaultSecurityEnvironmentImpl getUsername
SEVERE: WSS0216: An Error occurred using Callback Handler for : UsernameCallback
3.10.2012 12:14:39 com.sun.xml.wss.impl.misc.DefaultSecurityEnvironmentImpl getUsername
SEVERE: WSS0217: An Error occurred using Callback Handler handle() Method.
javax.security.auth.callback.UnsupportedCallbackException: Username Handler Not Configured
huotari
3-Oct-12 5:10am
View
Now I'm not exactly sure what you want to achieve. If you want limit the number displayed items it should be done on the server side. Or do you want to filter out some items with jquery? Or do you want to pass a parameter to the server about how many items are shown? Are you even using a server as the source?
huotari
3-Oct-12 5:00am
View
Do you not have access to the server side code?
huotari
3-Oct-12 4:59am
View
What do you mean?
huotari
9-Feb-12 17:10pm
View
Yes ofcourse i could do that, i was wondering if you knew how to do that. Thank you for your replies i'll mark this as resolved.
huotari
9-Feb-12 16:43pm
View
Thank you again.
Maybe i explained it poorly. I will try again. In the 'IList<PhoneNumber>'-list i only have the entities to keep and to add, but the only way i can know what to delete, is to get the entities from db that that are related to the user, but are not in this list and it is this query that i don't know how to do. I know how to get the primary key property, by examinig the attributes EF generates. Do you know if it's possible to generate a query from ProperyInfo?
huotari
9-Feb-12 16:16pm
View
Yes ofcourse how stupid of me. Thank you. One question, how would you implement the delete operation without reading all the reords from database. Now i'm reading only the records that i'm going to delete. The only way i can think of how to do the delete operation is to read all the records and check if a record exits with that id in the 'new collection'.
huotari
10-Nov-11 9:51am
View
it is specified aspNetCompatibilityEnabled and not aspnetcompatibilityenabled
huotari
10-Nov-11 9:31am
View
I tried that but then the HttpContext.Current was null
huotari
21-Jun-11 7:44am
View
Thanks a lot
Show More