Click here to Skip to main content
15,887,746 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: functions Pin
Shmuel Zang14-Jul-15 18:46
Shmuel Zang14-Jul-15 18:46 
AnswerRe: functions Pin
Member 1184785019-Jul-15 12:31
Member 1184785019-Jul-15 12:31 
QuestionFile Upload doesn’t work on Mobiles Pin
Praveen Raghuvanshi13-Jul-15 6:57
professionalPraveen Raghuvanshi13-Jul-15 6:57 
QuestionBlob went away in IE 11? Pin
dbrenth10-Jul-15 10:06
dbrenth10-Jul-15 10:06 
Questionbrowser version detection window 7 machine and IE version 11 Pin
Member 118062861-Jul-15 5:39
Member 118062861-Jul-15 5:39 
AnswerRe: browser version detection window 7 machine and IE version 11 Pin
Richard Deeming1-Jul-15 7:52
mveRichard Deeming1-Jul-15 7:52 
Questionin MVC Edit page, how to check for null values? Pin
Member 1173386829-Jun-15 11:28
Member 1173386829-Jun-15 11:28 
AnswerRe: in MVC Edit page, how to check for null values? Pin
Richard Deeming30-Jun-15 1:22
mveRichard Deeming30-Jun-15 1:22 
Member 11733868 wrote:
if ($('#TTest1').val(null))

The .val(value) version[^] of the val method sets the value of the matched elements to the specified value, and returns the set of matched elements.

Due to javascript's strange concept of "truthy" variables, the returned jQuery object will always be considered to be "true", and the code within the if block will always execute.

If you want to test whether the specified element's value is empty, you need to call val without passing any arguments, and then test the return value:
JavaScript
if ($('#TTest1').val() === '') { ...




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: in MVC Edit page, how to check for null values? Pin
Member 1173386830-Jun-15 17:01
Member 1173386830-Jun-15 17:01 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Afzaal Ahmad Zeeshan30-Jun-15 22:10
professionalAfzaal Ahmad Zeeshan30-Jun-15 22:10 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Member 117338681-Jul-15 13:46
Member 117338681-Jul-15 13:46 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Afzaal Ahmad Zeeshan1-Jul-15 14:50
professionalAfzaal Ahmad Zeeshan1-Jul-15 14:50 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Richard Deeming1-Jul-15 1:17
mveRichard Deeming1-Jul-15 1:17 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Member 117338681-Jul-15 13:56
Member 117338681-Jul-15 13:56 
AnswerRe: in MVC Edit page, how to check for null values? Pin
Afzaal Ahmad Zeeshan30-Jun-15 22:07
professionalAfzaal Ahmad Zeeshan30-Jun-15 22:07 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Member 117338681-Jul-15 13:40
Member 117338681-Jul-15 13:40 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Afzaal Ahmad Zeeshan1-Jul-15 14:49
professionalAfzaal Ahmad Zeeshan1-Jul-15 14:49 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Member 117338681-Jul-15 15:01
Member 117338681-Jul-15 15:01 
Questionexternal javascript not working Pin
nordyck29-Jun-15 7:31
nordyck29-Jun-15 7:31 
AnswerRe: external javascript not working Pin
Kornfeld Eliyahu Peter29-Jun-15 8:13
professionalKornfeld Eliyahu Peter29-Jun-15 8:13 
GeneralRe: external javascript not working Pin
Member 1173386829-Jun-15 12:47
Member 1173386829-Jun-15 12:47 
AnswerRe: external javascript not working Pin
Leng Vang2-Jul-15 9:38
Leng Vang2-Jul-15 9:38 
Questionjquery slideshows Pin
vikkismarty29-Jun-15 5:21
vikkismarty29-Jun-15 5:21 
QuestionStore one value from rows of data in a table Pin
Rajesh_198025-Jun-15 3:29
Rajesh_198025-Jun-15 3:29 
AnswerRe: Store one value from rows of data in a table Pin
jkirkerx26-Jun-15 8:46
professionaljkirkerx26-Jun-15 8:46 

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.