13 January 2011

Playing with JavaScript

Hello folks,

I am a programmer that dislike working with the client-side in web programming.
I dislike to do somethings like on button click, go and disable the textbox, and alike.

Nowadays I am working with GWT that do that some of that dirty work for me. but I really wanted to try doing some Javasript myself, and the following is a simple valueless example, just for fun :)


<html>
  <head>
    <script language="Javascript" type="text/javascript">
    function submitUserAction(rowId)
    {
        var flage = confirm("Are you sure?");
        if(flage)
        {
            deleteRow(rowId);
        }
    }
    
    function deleteRow(rowId)
    {
        
        alert("deleting Row " + document.getElementById("rowId").value );
    }
    
    function changeCascade()
    {
        document.getElementById("lbl").value = document.getElementById("bla").value;
        document.getElementById("rowId").value = document.getElementById("bla").value;
        
        document.getElementById("lbl").size = document.getElementById("bla").size++;
    }
    
    </script>

    <title></title>
  </head>
  <body>
    <input type="button" value="click me"  onclick="submitUserAction()" />
    <input type="text" id="bla" value onkeyup="changeCascade()"  />
    <input type="hidden" id="rowId" />
    
    <input type="text" id="lbl" value= "****" />
    
  </body>
</html>


And again, it is just for fun :)
Post a Comment