Wednesday 29 April 2015

Enter to onsubmit in html or catching Enter key?

Here is the solution, you are looking for

HTML CODE:

<form id="myform" onsubmit="return myFunction()">
          <input type="text" id="textbox">
          <input type="submit" id="mysubmitid" value="Go">

</form>


JAVA SCRIPT:

$(document).ready(function()
{
    $('#textbox').keypress(function(ev)
    {
            //If user pressed Enter Key then trigger Submit click
            if(ev.keyCode==13)
            $('#mysubmitid').click();
            });
});


Thursday 23 April 2015

PHP - auto refreshing page

<meta http-equiv="refresh" content="5" > 

just add it after the head tags

where 5 is the time your page will refresh itself