Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Tuesday, June 26, 2012

Pass a previous value in a select box

Renamed: Set a default select option when normal default is blank.
Let's say you want to do an event on a select onclick ... maybe something like a select with a blank as default, but if it's clicked, you want to change it to some other default (today's month?) ... but you also want that original blank to be selectable to "erase" the entry. This does not require jQuery or ASP. No need for a library to do this. Use it how you want.



    <script type="text/javascript">
        function setDefault(el) {
            if (el.previousValue != "") {
                return;
            }
            if (el.value) {
                return;
            }
            if (el.value == "") {
                el.value = "choose me"
            }
        }
    </script>
    <select onclick="setDefault(this)" onfocus="this.previousValue=this.value">
        <option value=""></option>
        <option value="skip me">skip me</option>
        <option value="choose me">choose me</option>
    </select>
Code marked up with quickhighlighter.com

Wednesday, February 3, 2010

Use Canned Responses to get an HTML signature in GMAIL

This might or might not appease you, gentle reader, but Mother is the necessity of invention.

Goal: Get an HTML signature in GMail. This has the added benefit of being cross browser, cross platform, and follows you where you go.
Result: eh. It's a slight pain, but cross platform.

1) Turn off your signature in GMail. (Settings, General, Signature, (*) No Signature, Save Changes)
2) Turn on Canned Responses in Labs. (Settings, Labs, Canned Responses (about half way down), (*) Enable, Save Changes)
3) Compose a message, Press Enter a time or two, then paste or create your HTML signature within the body of the message. (You might copy/paste this from Outlook or a previous email).
4) Click Canned Responses now under Subject
5) Click New Canned Response ...
6) Give it a descriptive name, click OK.
7) Now you can click "Canned Responses"/Insert (your signature here) any time you want this signature.

Hope you like it!
--
Gerald

Blog Archive