In phpbb, when you post, and im the message place (here) when you leave it empty it says "You must enter a message before posting", its great as you dont post empty posts and stuff
I have a uploading picture script, on my site, ((C) Stickied Group)
Im wanting to somehow to add a script or something that can be made into the "Sticky It!" button so that if its empty or hasnt choosed a file to upload it'll say "Please select a file before stickying"
Im so lost,
I added this in the posting_body.tpl
Code: Select all
function checkUpload() {
formErrors = false;
if (document.post.message.value.length < 2) {
formErrors = "{L_EMPTY_UPLOAD}";
}
if (formErrors) {
alert(formErrors);
return true;
} else {
bbstyle(-1);
//formObj.preview.disabled = true;
//formObj.submit.disabled = true;
return true;
}
}
Code: Select all
'L_EMPTY_UPLOAD' => $lang['Empty_upload'],
Code: Select all
<form action="http://www.stickied.net/index.php" method="post" enctype="multipart/form-data" target="_blank" method="post" name="post" onsubmit="return checkUpload(this)">
and in lang_main (in lang_english folder)
Code: Select all
$lang['Empty_upload'] = 'You must select a file to upload before sticking.';
anyone please help, i dont want a solution preferably, but someone to teach me how to do it and where more to add, as i want to learn
thanks
Copyright Stickied Group2006 Posted after permission