Thursday, August 28, 2008

Service providers Inspire.Net and Orcon collect TUANZ awards

TUANZ award winners named Read More

You can validate the length of input of an ordinary TextBox using the MaxLength attribute.  However, this doesn't work if the TextBox has a TextMode of Multi-line.  In those instances, use this piece of code.

<script type="text/javascript" language="javascript">

   

    function MaxLength()

    {

        var txt = $get("<%=ResponseNote_TextBox.clientid %>");

        var msg = $get("<%=Message_Label.clientid %>");

       

        if (txt.value.length > 500)

        {

            SelectText();

                                                           

            msg.className = "Failure";

            msg.innerHTML = "* Response has more than 500 characters";

        }

        else

        {

            if (msg.innerHTML == "* Response has more than 500 characters")

            {

                msg.innerHTML = "";

            }

        }

    }

   

    function SelectText()

    {

            var txt = $get("<%=ResponseNote_TextBox.clientid %>");

            var rng = txt.createTextRange();

 

            rng.moveStart("character", 501);

            rng.moveEnd("character", 0);

            rng.select();

    }

   

    function RemoveCRLFs()

    {

   // debugger;

    var txt = $get("<%=ResponseNote_TextBox.clientid %>");

    var str = window.clipboardData.getData("Text");

   

    str = str.replace(/(\s*(\r?\n|\r))+$/, '');

   

    txt.value = str ;

       

    }   

       

       

</script>        

 

Page_load:

ResponseNote_TextBox.Attributes.Add("onblur", "javascript:MaxLength()")

ResponseNote_TextBox.Attributes.Add("onpaste", "javascript:RemoveCRLFs()")

 

Read More

It was only in 2001 that China began to make a serious effort in microprocessor development Read More

But Firefox 3 adds a host of welcome improvements Read More

Mac OS X accounts for 4.5% of the business operating system market, says Forrester Read More

So it appears that the petition which was calling for a referendum on the "anti smacking bill" (which was very poorly named so by the media, if it has been called the "anti whacking kids so hard it causes injury bill" not many people would complain I'm sure) was verified as achieving the level required to trigger a referendum.  That's great and all, democracy in work, I don't need to agree with the premise to agree with your right to be heard.

BUT

Am I the only person to see the serious flaw.  Here's the question that the petition, and apparently the forthcoming referendum will  pose:

"Should a smack as part of good parental correction be a criminal offence in New Zealand?"

Seems innocuous enough you say.  But let's break it down...

If you say "Yes it should be illegal" to on the face of it indicate that you are "anti smacking" then by the terms of reference you are indicating that you think that "good parental correction" should be criminal. 

The question has asserted the answer it wants, it states that "a smack [is a] part of good parental correction" before it even gets to asking the question about that!

So it puts anybody with half a mind in a real quandry when this referendum (which appears will be a postal ballot next year) arrives, at least if you are opposed to phyical discipline.  I think I'll simply return the ballot voided to indicate that the question is invalid.

Now, I don't know the rules regarding referenda, but if the government is not bound to use the same question as was posed in the petition, then perhaps somebody in government could come up with a fairer question to ask,

Read More

No comments: