• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

disable button in html 5.0 with javascript based on one-four variables example

 
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I have this javascript above.

I need to be able to compare the

recordid
tableid
viewid
vrid

to what is being passed in and gray out an edit button if the values are not equal.

I have looked and looked for examples and do not know what to do about this. Any help would be appreciated.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"This"? With a capital?
 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
var check = [
'recordid',
'tableid',
'viewid',
'vrid''];
localStorage.check = JSON.stringify(check);

// later that evening…
var html5docs = JSON.parse(localStorage.check);
alert('There be ' + html5docs.length + 'check in the house');


I am trying to figure out if I can use this code or something like it to stringify the variables passed in as html 5.0 storage objects and somehow to compare them to what has been passed to the page to turn off a button if the variables do not match what has been passed to the page.
 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator





I am trying to figure out if I can use this code or something like it to stringify the variables passed in as html 5.0 storage objects and somehow to compare them to what has been passed to the page to turn off a button if the variables do not match what has been passed to the page.
 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I am trying to figure out how to store these values that get passed to the page from within a frames setup and then check to see if they have been passed in for later retrieval.
 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use the HTML 5.0 storage feature to store up to four variables. Could you have a look and point me in the right direction?




How could I compare the recordid, tableid, viewid, and vrid to what is passed to the page to be able to gray out an edit button? Simple question, but lots of ways to fix.

Any help would be appreciated.
 
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This code:

Is creating an array with 4 strings in it, and then storing that in local storage, I'm not sure why you would do that? It's also not clear to me how the various snippets of code you've posted on this thread are supposed to connect together, can you post one complete example?

Here's a quick tutorial on localStorage: if you have four variables like this:

Then you can wrap them up into an object and stick them in localStorage like this:

You would then later extract the object with code like this:

Here is some code you can play with.

Of course if it's just four variables, you could just stick them into localStorage directly and save yourself the hassle of the wrapping and JSON manipulation.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are the first person that I have ever seen referring to html5 as 5.0.
 
Rob Crowther
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It might get more common now that we have HTML 5.1 in progress. Of course no-one really took to calling HTML4 "HTML 4.01".
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic