Rabu, 25 September 2013

PHP Indonesia - Facebook: Mau tanya nih, kalau scrip untuk field input yang ...

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 Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Geek Squad from Best Buy

Get instant online support. We can fix computers, cameras, car technology and more. Talk to us today.
From our sponsors
Mau tanya nih, kalau scrip untuk field input yang ...
Sep 25th 2013, 09:13, by Yanuar Arifianto

Yanuar Arifianto 9:13am Sep 25
Mau tanya nih, kalau scrip untuk field input yang mewajibkan jadi format begini:

x.xxx.xxx

gimana ya? Jadi segment pertama (sebelum titik pertama) nilainya boleh x, boleh xx.
Segment kedua (antara kedua titik) wajib xxx alias 3 karakter.
Segment ketiga (setelah titik terakhir) wajib xxx alias 3 karakter.

Kalau ada yang bisa bantu mohon pencerahannya hehe. Typenya varchar aja ya.

Cahya Dsn 9:19am Sep 25
suggest nubi:
jadikan tiga inputan
//..
<input type='text' name='segment1' size='2' maxlength='2' placeholder='XX' />:
<input type='text' name='segment2' size='3' maxlength='3' placeholder='XXX' />:
<input type='text' name='segment3' size='3' maxlength='3' placeholder='XXX' />
//..

cmiiw ^_^V
ane nubi gak bisa koding cuman ngasal koming aja.. jangan dibata

*tinggal check panjang karakter yg dimasukkan ditiap inputan dengan method .length di javascript
*tinggal concate string diprocess-nya

Yanuar Arifianto 9:32am Sep 25
Iya yang script di atas tadi udah saya coba, pake 3 input field, trus keluarannya pake query database ambil perfield (persegment), trus di antara field/segment pake echo tanda titik (.).

Cuma, saya penginnya kalau ada sih yang inputan jadi 1. Kayak pas ngetik IP di settingan IPV4 windows itu lho.

Ada saran lain?

Cahya Dsn 9:34am Sep 25
google: 'masked input jquery'

Yanuar Arifianto 9:35am Sep 25
Siap laksanakan.

Yanuar Arifianto 9:37am Sep 25
Makasih Pak @cahya dsn, ketemu pluginnya di sini http://digitalbush.com/projects/masked-input-plugin/
Makasih yooo :D.

Kanedi Doank 10:06am Sep 25
cara simpel dari pemula.. hehe :

<script type="text/javascript">
$(document).ready(function(){
$("#tes").on('keyup',function(){
var vaal = $(this).val();
if($(this).val().length == 2) $(this).val(vaal+".");
if($(this).val().length == 6) $(this).val(vaal+".");
});
});
</script>
<input type="text" name="tes" id="tes" maxlength="9">

Yanuar Arifianto 10:06am Sep 25
Siiip nanti dicoba semuanya :D.
Mau pulang dulu nih hehe.

Kanedi Doank 10:07am Sep 25
nb: script js atau jquery sebelonnye harus di load dulu diatas :3

Yanuar Arifianto 10:38am Sep 25
Iya Om :D.

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