How To ? - Forum

Forum Navigation
You need to log in to create posts and topics.

How To ?

Hi @Luishp

I have downloaded this toogle switch from this excellent site https://uiverse.io/, but I am stupid because I do not know how to get the value (0,1 I suppose) of this object.

Can you help me ?

Regards

 

 

Uploaded files:
  • You need to login to have access to uploads.

@phil78 as you are entering HTML code directly, just turn this:

<input class="bauble_input" id="bauble_check" name="bauble" type="checkbox">

Into this:

<input ng-model="$root.checkboxvalue" class="bauble_input" id="bauble_check" name="bauble" type="checkbox">

This way the variable [checkboxvalue] will store the checkbox value (true or false)
Check the attached sample.

Regards.

 

Uploaded files:
  • You need to login to have access to uploads.

@Luishp thanks a lot Luis

hi @luishp

I assign a value true to [checkboxvalue] $root.checkboxvalue  before opening the page. It works locally but not after uploading on the server, the object start always with false.

Any idea ?

@phil78 as it's pure client side code it should work exactly the same in local and when uploaded to the server.
Only possible explanation I can think of is you are executing a cached version (Presss Ctrl-F5 to fully reload the app)

No, I did clear the cache. But what I wrote isn't entirely accurate. When I call the app using the toolbar button (file///:...), it works. But when I call it via HTTP locally or on the server, it doesn't work.

@phil78 I need to see a sample to better understand the problem.

@luishp Hi Luis

I think I understand the problem. I initialized my variables from a GetItem, but true or false is returned as “true” or “false,” which the object does not understand.

luishp has reacted to this post.
luishp