2012-11-15, 02:28 PM
Hey,
I've made a page myself with the functions I want. But as I am still learning PHP & MyBB codes I am unsure if my code is really clean..
I hope someone of you can tell me what I can do better or what I should improve. If you find any bugs or so, or know a better code, I would really appreciate it if you can give me advice how to make it better.
Please don't blame me for being messy, I tried my best to come with something and what actually works - but ye,, messy code
here is the source:
http://pastebin.com/CB5BEKtp
and here is the lil' jscript:
Thanks in advance!!
Tankey
I've made a page myself with the functions I want. But as I am still learning PHP & MyBB codes I am unsure if my code is really clean..
I hope someone of you can tell me what I can do better or what I should improve. If you find any bugs or so, or know a better code, I would really appreciate it if you can give me advice how to make it better.
Please don't blame me for being messy, I tried my best to come with something and what actually works - but ye,, messy code
here is the source:
http://pastebin.com/CB5BEKtp
and here is the lil' jscript:
function DisplayTime(){
if (!document.all && !document.getElementById)
return
timeElement=document.getElementById? document.getElementById("curTime"): document.all.tick2
var CurrentDate=new Date()
var day=CurrentDate.getDate()
var month=CurrentDate.getMonth() + 1
var year=CurrentDate.getFullYear()
var hours=CurrentDate.getHours()
var minutes=CurrentDate.getMinutes()
var seconds=CurrentDate.getSeconds()
if (minutes<=9) minutes="0"+minutes;
if (seconds<=9) seconds="0"+seconds;
var currentDatum=day+"-"+month+"-"+year;
var currentTime=hours+":"+minutes+":"+seconds;
timeElement.innerHTML="<font style='font-size:12px;font-weight:bold;'>"+currentDatum+" "+currentTime+"</b>"
setTimeout("DisplayTime()",1000)
}
window.onload=DisplayTime
function validateForm(submit_notification)
{
if (""==document.forms.submit_notification.item_title.value)
{
alert("You forget to enter a title..");
document.forms.submit_notification.item_title.focus();
return false;
}
else if (""==document.forms.submit_notification.item_summary.value)
{
alert("You forget to enter additional information..");
document.submit_notification.item_summary.focus();
return false;
}
else if ("0"==document.getElementById('item_status').value)
{
alert("Please choose a status..");
document.submit_notification.item_status.focus();
return false;
}
else if ("0"==document.getElementById('item_prefix').value)
{
alert("Please choose a prefix..");
document.submit_notification.item_prefix.focus();
return false;
}
}
function CheckForm()
{
if (""==document.forms.submit_update.update_summary.value)
{
alert("You forget to enter update text..");
document.forms.submit_update.update_summary.focus();
return false;
}
else if ("0"==document.getElementById('update_status').value)
{
alert("Please choose a status..");
document.submit_update.update_status.focus();
return false;
}
}
Thanks in advance!!
Tankey