Jump to content

nogray

Members
  • Posts

    930
  • Joined

  • Last visited

Everything posted by nogray

  1. use document.getElementById('ref id here').innerHTML this should work in everything. (given that ref have an id).
  2. nogray

    onchange

    Just add the this.value to the url like this [code] <SELECT "cars" onchange="window.location='cars.php?sort='+this.value"> <OPTION value="ford">ford</OPTION> <OPTION value="toyota">toyota</OPTION> </SELECT> [/code]
  3. If the the text input (not textarea) have the focus, the form should be submitted by hitting the enter key. You can set the focus to the text input when the page load.
  4. I notice the solutions where a bit too complicated for this problem time() function in php will return the number of seconds, so if you have two times and subtract them, you'll get the difference in seconds. All you have to do is convert that into minutes, hours, days, etc... I wrote a small function that will do that [code]function convert_time($seconds){     $f_minutes = $seconds / 60;     $i_minutes = floor($f_minutes);     $r_seconds = intval(($f_minutes - $i_minutes) * 60);          $f_hours = $i_minutes / 60;     $i_hours = floor($f_hours);     $r_minutes = intval(($f_hours  - $i_hours) * 60);          $f_days = $i_hours / 24;     $i_days = floor($f_days);     $r_hours = intval(($f_days - $i_days) * 24);          if ($i_days > 0) $r = "$i_days days ";     if ($r_hours > 0) $r .= "$r_hours hours ";     if ($r_minutes > 0) $r .= "$r_minutes min";     else $r = "less than a minute";          return $r; }[/code] the f_ is for float i_ is for int and r_ is the return value. I only need days, so you can keep going for months and years the same way. Good luck, Wesam Saif [a href=\"http://www.nogray.com\" target=\"_blank\"]http://www.nogray.com[/a]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.