Moreless 2 days i’m not writing here.
Recently i’m very busy…
You know why..? NO, I’m not a workaholic…:D
Anyway, i want to write about javascript.
Why…? It’s about manage “multi action on drop down”
Have you ever think, How to create a form which it without submit button,
but only use drop down menu, where on list contain action by each list.
Ok, Think that we should edit or delete option.
O ya, On this
<?php //action.php//Better if you control referer and else that you thing it a security issue
$action = isset($_POST['action']) : $_POST['action'] ? 0 ;
if($action == 1 ){
//Delete action here
} elseif ( $action ==2 ){
//Edit action here
} else {
//default
}
?>
And HTML page is like this
<html>
<head>
<!– Everything about HTML head //–><script language=”Javascript”>
<!–
function goAction(n){
var f = document.frm1;
f.id.value = n;
f.submit();
}
//–>
</script>
</head>
<body>
<form method=”post” name=”frm1″ action=”action.php”><input type=”hidden” name=”id”>
<table width=”100%”>
<tr bgcolor=”#CCCCCC”>
<td>Computer</td>
<td>$US 340</td>
<td>
<select name=”action” onchange=”goAction(234)”>
<option value=”0">Action</option>
<option value=”1">Delete</option>
<option value=”2">Edit</option>
</select>
</td>
</tr>
<tr bgcolor=”#CDCDCD”>
<td>Rack Server</td>
<td>$US 1422</td>
<td>
<select name=”action” onchange=”goAction(234)”>
<option value=”0">Action</option>
<option value=”1">Delete</option>
<option value=”2">Edit</option>
</select>
</td>
</tr>
</table>
</form>
</body>
</html>
Any other idea?…
I ‘m waiting


