Site Archives html

Checkbox value


When you post a form with checkbox it dose not return any value when the checkbox is not ticked.
This is something that should have been fixed a long time ago.
But for now here is the solution:
 
<form action="?" method="post">
<input name="myCheckbox" type="hidden" value="0" />
<input name="myCheckbox" type="checkbox" />
</form>
 
You put an hidden input before checkbox input with the same [...]

favicon2png


Here is a script to download the favicon.ico files from a website and save it as a png file.
You must have imagemagick installed on your server to convert the ico file to png.
 
<!— html code —->
<form action="?" method="post">
<input id="site" name="site" type="text"
value="<?php echo $_POST['site']; ?/>" />
<input type="submit" />
</form>
 
< ?php
//— favicon2png by Alireza Balouch @ swape.net 2008
 
if($_POST[’site’] [...]

swapeForm


Here is an easy php 5 class to make dynamic form table.
I made this class to make dynamic forms. With this class you don’t have to write html code for form and a table.
Here is how to use this class:
 
< ?php
include(’swapeForm.php’);
 
$form = new swapeForm();
$form->add(’Name’); // adding input
$form->setAttrib(’id’ , ‘formName’); // adding atributes to [...]

CSS shadow


Here is a fast method to make an shadow around your text boxes.
Using only CSS and not any background image, makes it easy and dynamic.

Here is how the CSS code looks like:
 
 
.out{
display:block;
background:#CCC;
position:relative;
width:9em;
}
.in {
background:#fff;
border:1px solid #999;
position:relative;
text-align:center;
padding:5px;
[...]

CSS pop-ups


Here is an good example how to hide layers and show them on mouse over effect.

Here is how the CSS part looks like:
 
div#testlinks {
position: absolute;
top: 20px; left: 12px; width: 166px;
font: 12px Verdana, sans-serif;
}
div#testlinks a {
display: block; font: bold 1em sans-serif;
padding: 5px 10px; margin: 0 0 [...]