Welcome to Code Couch

Monthly archive for August 2007

  • How to prevent page reloading with a non-submitted form

    This technique informs the user if they navigate away without submitting the form on the page (whilst letting them change their mind and remain on the page). Useful to prevent the loss of unsaved changes on a web form.

  • Tips on converting strings into numbers

    I recently ran into some strange behaviour using parseInt() to convert a string into an integer. It turns out that passing in the base (radix) of the number that the string prepresents is important to ensure the desired behaviour.