Skip to content

Instantly share code, notes, and snippets.

@computercarguy
Created June 26, 2012 18:00
Show Gist options
  • Save computercarguy/2997528 to your computer and use it in GitHub Desktop.
Save computercarguy/2997528 to your computer and use it in GitHub Desktop.
PHP code to put a day select box and a year text box into an HTML form.
function YearInput(){
$HTMLCode = "<input type=\"text\" id=\"Year\" name=\"Year\" size=\"5\" maxlength=\"4\" value=\"Year\" onfocus=\"Focus('Year','Year')\" ";
$HTMLCode .= "onkeyup=\"NoChrs('Year')\" onblur=\"Blur('Year','Year');\" /></td>".Chr(13);
return $HTMLCode;
}
function DaySelect(){
$HTMLCode = "<select name=\"day\" id=\"day\">".Chr(13);
for ($i=1;$i<32;$i++){
$HTMLCode .= "<option value=\"".$i."\">".$i."</option>".Chr(13);
}
$HTMLCode .= "</select>".Chr(13);
return $HTMLCode;
}
// To be used with the Focus() and Blur() JavaScript functions found at the repository: git://gist.github.com/2997403.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment