Minggu, 28 Juli 2013

PHP Indonesia - Facebook: [ASK] mas mas mau tanya; ada yang tau gak bikin in...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
[ASK] mas mas mau tanya; ada yang tau gak bikin in...
Jul 28th 2013, 18:45, by Wahyu Linkmu

Wahyu Linkmu 6:45pm Jul 28
[ASK]
mas mas mau tanya; ada yang tau gak bikin inputan type checkbok nantinya data yang di checked nilainya sesuai dengan valuenya dan yang tidak di cek lis maka nilainya null('0'),,,

Cahya Dsn 6:46pm Jul 28
null? apa nol(0) ?

Wahyu Linkmu 6:47pm Jul 28
0 mas,,, heheheheheh

Cahya Dsn 6:48pm Jul 28
contoh script yg udah dibuat? ..utk input type checkbox, maka jika tidak di checked maka variabel dengan nama sesuai 'name' dari checkbox tersebut tidak akan terkirim pada saat form di submit ^_^V

Wahyu Linkmu 6:51pm Jul 28
udah si tapi ya masih sama kayak inputan checkbox biasa,,, ketika yang gak di ceklis maka tidak terkirim nilainya,,, scriptnya kayak gini [script]<form action="test.php" method="post">
<input type="checkbox" name="check_list[]" value="value 1" >
<input type="checkbox" name="check_list[]" value="value 2">
<input type="checkbox" name="check_list[]" value="value 3">
<input type="checkbox" name="check_list[]" value="value 4">
<input type="checkbox" name="check_list[]" value="value 5">
<input type="submit" />
</form> [/script]

Wahyu Linkmu 6:51pm Jul 28
menurut mas untuk membuat seperti itu di php memungkinkan gak ya,,?

Wahyu Linkmu 6:54pm Jul 28
hehehehehehehe mas cahya alhamdulilah ni dah ketemu solusinya di neted getnya atau posnya di kasih $active = isset($_POST['Active']) && $_POST['Active'] ? "1" : "0";

Cahya Dsn 7:02pm Jul 28
coba pelajari model-model ini:

<!DOCTYPE html>
<html>
<head>
<title>Test Checkbox</title>
</head>
<body>
<form method="post">
<?php
$cbx=array();
for($i=1;$i<=5;$i++)
{
$cbx[]=isset($_POST['cbx$i'])?$_POST['cbx$i']:0;
echo "Checkbox #$i <input type='checkbox' name='cbx$i'".(isset($_POST['cbx$i'])?" checked='checked'":"")." value='$i' /><br/>\n";
}
echo "<input type='submit' />\n";
echo "<pre>";
print_r($cbx);
echo "</pre>";
?>
</form>
</body>
</html>

Wahyu Linkmu 7:03pm Jul 28
ok mas terimakasih....

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar