me,myself,english and programming..

Javascript to generate Query String

For my future reference, I know that I will need this later on.

 

function create_request_string(theForm)
{
var reqStr = "";

for(i=0; i < theForm.elements.length; i++)
{
isFormObject = false;

switch (theForm.elements[i].tagName)
{
case "INPUT":

switch (theForm.elements[i].type)
{
case "text":
case "hidden":
reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value);
isFormObject = true;
break;

case "checkbox":
if (theForm.elements[i].checked)
{
reqStr += theForm.elements[i].name + "=" + theForm.elements[i].value;
}else{
reqStr += theForm.elements[i].name + "=";
}
isFormObject = true;
break;

case "radio":
if (theForm.elements[i].checked)
{
reqStr += theForm.elements[i].name + "=" + theForm.elements[i].value;
isFormObject = true;
}
}
break;

case "TEXTAREA":

reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value);
isFormObject = true;
break;

case "SELECT":
var sel = theForm.elements[i];
reqStr += sel.name + "=" + sel.options[sel.selectedIndex].value;
isFormObject = true;
break;
}

if ((isFormObject) && ((i+1)!= theForm.elements.length))
{
reqStr += "&";
}

}

return reqStr;
}

Inspired Story About Small Deed..

I was born in a secluded village on a mountain. Day by day, my parents plowed the yellow dry soil with their backs towards the sky.

I have a brother who is 3 years younger than me. I wanted to buy a handkerchief, which all girls around me seemed to have. So, one day I stole 50 cents from my father’s drawer. Father had discovered about the stolen money right away.

He made me and my younger brother kneel against the wall as he held a bamboo stick in his hand. “Who stole the money?” he asked. I was stunned, too afraid to talk. Neither of us admitted to the fault, so he said, “Fine, if nobody wants to admit, you two should be beaten!”

He lifted up the bamboo stick. Suddenly, my younger brother gripped father’s hand and said, “Dad, I was the one who did it!” The long stick smacked my brother’s back repeatedly. Father was so angry that he kept on whipping my brother until he lost his breath. After that, he sat down on our stone bed and scolded my brother, “You have learned to steal from your own house now. What other embarrassing things will you be possibly doing in the future? You should be beaten to death, you shameless thief!”

Read the rest of this entry »

Never say never…

 

Never say never (never never never)
Pick it up, pick, pick, pick it up
Pick it up, pick, pick, pick it up
Pick it up, pick, pick, pick it up
Pick it up, pick, pick, pick it up

You see I never thought that I could walk through fire
I never thought that I could take a burn
I never had the strength to take it higher
Until I reached the point of no return

And there’s just no turnin back
When your heart’s under attack
Gonna give everything I have
It’s my destiny

Read the rest of this entry »

Tombo Ati – Ubat Hati

 

Obat Hati ada lima perkaranya….

Read the rest of this entry »

Hold my hand or I hold yours?

holdinghands

Received this from somewhere….so I’m sharing it here in my blog.

“Little girl and her father were crossing a bridge.

The father was kind of scared so he asked his little daughter, ‘Sweetheart, please hold my hand so that you don’t fall into the river.’

The little girl said, ‘No, Dad. You hold my hand.’

‘What’s the difference?’ Asked the puzzled father.

‘There’s a big difference’, replied the little girl. ‘If I hold your hand and something happens to me, chances are that I may let your hand go. But if you hold my hand, I know for sure that no matter what happens, you will never let my hand go.’

In any relationship, the essence of trust is not in it’s bind, but in it’s bond.

So hold the hand of the person who loves you rather than expecting them to hold yours…

God doesn’t give you the people you want, He gives you the people you NEED. To help you, to hurt you, to love you, to leave you and to make you into the person you were meant to be.”