How to Reset and Clear a Form Field or Textarea with Stateless Components in React
Stateless components are nice. They are simple to use and understand but can become tricky when you start thinking about data and how to manage state. In general, the consensus seems to be that if your UI is going to need state, then at least the componen...
Written by Sean Behan on 10/21/2018
Onchange Event Fired from Select Field in Rails Form
In the view there is a regular Rails form and a javascript function that will be triggered when the country select field is changed. The javascript function will make an ajax request to the country_select url with the country code passed as the id variabl...
Written by Sean Behan on 06/17/2012
Listing Files and Directories with PHP
Listing all files and directories using PHP 5.
<?php
$files = array(); $dir = dir(".");
while(false!==($file=$dir->read())):
if(($file{0}!=".") && ($file{0}!="~") && (substr($file, -3)!="LCK")
&& ($file!=basename($_SERVER["PHP_SELF"]))):
...
Written by Sean Behan on 06/17/2012