Membuat menu pulldown dengan menggunakan javascript
Buat File pulldown.js dan isi dengan script ini
Showing posts with label java script. Show all posts
Showing posts with label java script. Show all posts
Friday, May 17, 2013
Enter Hand on From
Terkadang dalam sebuah form penginputan data kita memerlukan beberapa hal kecil yang mendasar, salah satunya adalah pada saat di form kita harus menekan enter untuk ke field berikutnya dalam php script perlu adanya penambahan script.
Popup window link
<..script language="javascript">
window.name = 'parentWindow';
var newPopupWindow;
function popupLinkOption(url,width,height) {
newPopupWindow=window.open(url,"childWindow","height="+height+",width="+width+",left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no,menubar=no,location=no");
newPopupWindow.moveTo(screen.width/2-300,screen.height/2-250);
}
<../script>
Saturday, June 9, 2012
Saturday, April 16, 2011
Format Number
function formatNumber()
{
var obj = document.getElementById('txtExample');
var num = new NumberFormat();
num.setInputDecimal('.');
num.setNumber(obj.value); // obj.value is '2500'
num.setPlaces('0', false);
num.setCurrencyValue('Rp. ');
num.setCurrency(true);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true, ',', ',');
obj.value = num.toFormatted();
}
//-->
</script>
</head>
<form>
<input type="text" size="30" value="2500" id="txtExample" />
<input type="button" value="Format" onclick="formatNumber();" />
</form>
</body>
</html>
{
var obj = document.getElementById('txtExample');
var num = new NumberFormat();
num.setInputDecimal('.');
num.setNumber(obj.value); // obj.value is '2500'
num.setPlaces('0', false);
num.setCurrencyValue('Rp. ');
num.setCurrency(true);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true, ',', ',');
obj.value = num.toFormatted();
}
//-->
</script>
</head>
<form>
<input type="text" size="30" value="2500" id="txtExample" />
<input type="button" value="Format" onclick="formatNumber();" />
</form>
</body>
</html>
Subscribe to:
Comments (Atom)