Our blog

 

Handy Easy Javascript

Javascript can seem daunting for new comers who are learning html and coding for the web. However there are a few dead easy things you can do with javascript which do not require any particularly complicated code and can make your site a bit smoother and slicker for the end user.

Form Submit on Change

A dead easy one to make forms automatically submit when people make a selection on a drop down menu. All you have to do is add onchange="submit();" into your opening select tag

HTML:
  1. <form action="index.php"> <select name="view" onchange="submit();"> <option>option1</option><option>option 2</option></select> </form>

Javascript Back Button

another really easy one - you can replicate the functionality of the back button. This is especially handy if you are displaying content in a javascript window without the usual controls.

HTML:
  1. <a href="javascript: history.go(-1)"><-- Back</a>

More Reading:

 

Leave a Reply