Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6184683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:34:42+00:00 2026-05-24T01:34:42+00:00

I am using this in part of my template: {{if !IsDefault}} <a href=# onclick=makeDefault(‘${Id}’);return

  • 0

I am using this in part of my template:

{{if !IsDefault}}
    <a href="#" onclick="makeDefault('${Id}');return false;">Make Default</a>
{{/if}}

Except when IsDefault is false it is not working. I even tried:

{{if IsDefault === false}}` and `{{if IsDefault == false}}

I have verified that the value actually is false in my json object that gets passed to the template.

I also tried this which works but is pretty ugly and I would prefer for it to just work how it should:

{{if IsDefault}}
{{else}}
    <a href="#" onclick="makeDefault('${Id}');return false;">Make Default</a>
{{/if}}

Also, if I change it to check for a true condition (doesn’t make sense but just tried it for debugging purposes)…

{{if IsDefault}}

…it works fine. Looks like it just has problems with the false values. I am getting the json via an jQuery ajax call and using knockout mapping with jquery tmpl. I get no js errors.

Any ideas on why testing for false or !false is not working?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:34:43+00:00Added an answer on May 24, 2026 at 1:34 am

    Try using {{if !(IsDefault())}}

    If you are using an observable that is not in an expression, then jQuery templates sees that it is a function and calls it as a function to get the observable’s value. If it is in an expression, then this doesn’t happen and you need to call your observable as a function (with no args) to get its value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: Maybe I should make this part clear. A user is writing the template.
I am using this condition as part of my where clause: exists (select *
The code we're using is straightforward in this part of the search query: myCriteria.Add(
I can run tasks as part of our functional tests just fine using this
I'm trying to setup the application server part of C2DM push messaging using this
I'm using AVAudioPlayer to play sound effects in an iPhone game. This is part
I am using Sql Server 2005 This is a part of my database diagram.
This is a two-part question. I'm using jQuery for a project and wanting to
Using the D3DX library that is a part of directX, specifically directx9 in this
We are using a third part library to render 3d. In this library there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.