Linked text and select fields

Just a quick snippet for my own reference (or yours) to link together text fields and select fields so that changes to one change the other.

Assumes the matched fields have IDs of :

  • text field: someFieldID
  • select field: someFieldIDSel

Assumes and initial, unselected Select option with a value of “invalid”.

It also prevents the insertion of illegal values into the text box.

// Selector sets text field ***
$('select.matchedSel').change(function () {
  var tVal = this.value;
  var tID = '#'+$(this).attr('id').slice(0,-3);
  if (tVal == 'invalid') {
    $(tID).val('')
  } else { $(tID).val(tVal); }
});
// Text field sets selector ***
$('input.matchedText').change(function () {
  var tVal = this.value.trim();
  var tID = '#'+$(this).attr('id')+'Sel';
  if (tVal == '') {
    $(tID).val('invalid')
  } else if ($(tID).find('option[value='+tVal+']').length) {
    $(tID).val(tVal);
  } else {
    $(this).val(''); $(tID).val('invalid'); procError(paramlist);
  }
});

Excel custom formatting and the hazards of cut and paste

Was assembling a project tracking spreadsheet in Excel with plenty of custom formatting rules to categorize and tracks those things that need to be categorized or tracked. It is not something I had done in a while, since I am used to being in Mac shops, but here Numbers was not an option.

So I set up my rules for each column and then started inserting new rows and cutting and pasting things into them all over the place.

Went to go change one of my rules for a column and discovered it now had not the original six custom formatting rules, but something closer to sixty. So what happened?

Continue reading

Canaries, legends, and heights

Have been working on a site and all of a sudden, this morning, it was broken.

AAAAHH!!!! Run around in a panick.

Then I noticed it was only broken in Chrome Canary (their dev browser) and the break was very specific: <legend> tags were having a height applied to them, perhaps inherited from their parent <fieldset> tag? The numbers didn’t add up, so it was hard to tell. Also, it only caused obvious display problems if the legends were being displayed as their own block instead of part of the field set border, but on inspection the blocks were still sized incorrectly behind the scenes.

Continue reading

Why tech speak is not a natural language

Why tech speak is not a natural language:

The required attribute is a boolean attribute. When specified, the element is required.

Constraint validation: If the element is required, and its value IDL attribute applies and is in the mode value, and the element is mutable, and the element’s value is the empty string, then the element is suffering from being missing.

For starters, I am pretty sure code cannot in and of itself “suffer,” though those of us that must deal with it are  different story.

From Common input element attributes courtesy of the W3C.

Tradition!

Who, nine to five, must scramble for a living,
drinking too much coffee, sitting in a cube?
And who gets to work with antiquated systems
that sometimes maybe even work?

State workers! State workers! Tradition!
State workers! State workers! Tradition!

Who can push a paper so it goes nowhere,
with an inbox here, an outbox there?
Who can turn a process into a nightmare
of endless waiting on the paperwork?

State workers! State workers! Tradition!
State workers! State workers! Tradition!

Grade 6 I got my benefits, Grade 1o I got a raise,
I’m taking the promotional exam. I hope it’s easy.

State workers! State workers! Tradition!
State workers! State workers! Tradition!

[Due to contractual disputes with the union, the last verse is currently in litigation and cannot yet be posted.]

State workers! State workers! Tradition!
State workers! State workers! Tradition!

Thinking inside the box

In spite of this trope having played itself out long ago, there are still many people who insist on thinking outside the box.

The problem with claiming to think outside the box is that thinking outside the box persists in using the box as a referent, a magicians slight of hand to get people to look at the box as being over there somewhere and never notice the extension cord connecting it to the new, firmly outside of the box idea being presented. If you are placing the new in relation to the box, you have not escaped the box. You are still trapped firmly within the context of the box.

Besides, thinking too far outside the box is as apt to get you medicated as wealthy. And the commitment involved in the former is probably much more manageable for most people.

Here at MoosePlum we make no pretense of thinking outside the box. Instead we dedicatedly and aggressively think firmly inside the box. In this we join many noble personages.

Continue reading

Little Synchroidiocies

A funny thought hit me while I was reading the details on a position I was applying for last week.

You see, I had to look up the term object relational mapping, which was listed in the experiential requirements bit of the job posting. Boringly, it just means moving data to and from objects in the code and relational databases.

This kicked around in the back of my head for a bit, then I had a little giggle fit that only someone who has spent their adult life stuck in IT could have.

Continue reading

Stupid Ideas: Use the Latest Technology

When trying to promote one’s self, or one’s Website, it is important that one take advantage of the newest and latest technologies.

For instance, spinning, flaming logos.

Or, in modern parlance, embracing every new JavaScript framework and sneering at last month’s as passé. It proves you can do really neat things with really neat other things, even if everyone is just using the exact same Bootstrap template.

The latest technology is chic. It’s cutting edge! It’s all about the self-promotion of pushing the envelope beyond what your customer’s browsers actually support. They’ll update eventually.

But really, a problem that often vexes any good application development and design is getting so caught up with the newest toys that things like audience needs get put on the back burner in favor of cool toys.

Why? Usually because it saves us from having to think about it. We don’t have to think about what the audience wants. We don’t have to think about whether what we are promoting is worth the effort. We don’t have to engage with the product. We just make it look pretty, ideally with someone else’s canned solution, or make it appropriately shiny and jangly. Done.

Sometimes pushing out new toys succeeds, and you create demand for something where none existed before, or at a bare minimum you trend for a bit as everyone oohs and aahs over your cleverness. But most of the time it just adds unnecessary clutter to the final product. The really old IBM ad above nails it on the head. It looks neat, but how does it address customer needs?

Compare Google Docs to Microsoft Office. Google Docs has actually be reducing functionality in their office suite, not increasing it. Why? Because it is not meant for desktop publishing, it is meant for sharing ideas online, collaboratively, in the easiest was possible. Once something in finalized, then export it to Word, or better LibreOffice, and give it to the content experts to make it look sharp. Google are masters of using the most advanced toys possible to make things as plain and and simple as possible. Though they are far from innocent on the latest technology trap. They are so determined to keep things as fresh as possible that the tools you are working with can change from one day to the next without even a hint of advance notice.