This you can do with the help of javascript, but if you are looking for serverside code to do it than its not possible without help of AJAX.