is there a way to change "Custom fields for image description"-questions from being opional to obligation-questions? my english is bad, but i really want people that upload pix on my page to anwer these questions.
http://forum.coppermine-gallery.net/index.php?topic=7901.0
http://forum.coppermine-gallery.net/index.php?topic=20965.0
http://forum.coppermine-gallery.net/index.php?topic=12369.0
hi gau gau,
can these solutions also help me? i tried them, but nothing changed. here s my transformed upload.php-code:
// The open_form function creates the Javascript verification code and the opening form tags.
// $path hold the form action path.
function open_form($path) {
echo <<<EOT
<script language="javascript" type="text/javascript">
function textCounter(field, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
}
function chkForm()
{
if(document.myform.user_field1_name.value == "")
{
alert("Please answer question no. 1!");
document.myform.user_field1_name.focus();
return false;
}
}
{
if(document.myform.user_field2_name.value == "")
{
alert("Please answer question no. 2!");
document.myform.user_field2_name.focus();
return false;
}
}
{
if(document.myform.user_field3_name.value == "")
{
alert("Please answer question no. 3!");
document.myform.user_field3_name.focus();
return false;
}
}
{
if(document.myform.user_field4_name.value == "")
{
alert("Please answer question no. 4!");
document.myform.user_field4_name.focus();
return false;
}
}
</script>
<form method="post" action="$path" ENCTYPE="multipart/form-data" name="myform" onsubmit="return chkForm();">
EOT;
}
hard to say without a link to your page ::)
sorry: www.panopti.de
Try// The open_form function creates the Javascript verification code and the opening form tags.
// $path hold the form action path.
function open_form($path) {
echo <<<EOT
<script language="javascript" type="text/javascript">
function textCounter(field, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
}
function chkForm()
{
if(document.myform.user1.value == "")
{
alert("Please answer question no. 1!");
document.myform.user1.focus();
return false;
}
}
{
if(document.myform.user2.value == "")
{
alert("Please answer question no. 2!");
document.myform.user2.focus();
return false;
}
}
{
if(document.myform.user3.value == "")
{
alert("Please answer question no. 3!");
document.myform.user3.focus();
return false;
}
}
{
if(document.myform.user4.value == "")
{
alert("Please answer question no. 4!");
document.myform.user4.focus();
return false;
}
}
</script>
<form method="post" action="$path" ENCTYPE="multipart/form-data" name="myform" onsubmit="return chkForm();">
EOT;
}
instead - you of course have to use the actual field names, not placeholders.
i tried with your code, but it didn`t work. then i deleted some " } {" and now its running. :) cool, thank you for the help
// The open_form function creates the Javascript verification code and the opening form tags.
// $path hold the form action path.
function open_form($path) {
echo <<<EOT
<script language="javascript" type="text/javascript">
function textCounter(field, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
}
function chkForm()
{
if(document.myform.user1.value == "")
{
alert("Please answer question no. 1!");
document.myform.user1.focus();
return false;
}
if(document.myform.user2.value == "")
{
alert("Please answer question no. 2!");
document.myform.user2.focus();
return false;
}
if(document.myform.user3.value == "")
{
alert("Please answer question no. 3!");
document.myform.user3.focus();
return false;
}
if(document.myform.user4.value == "")
{
alert("Please answer question no. 4!");
document.myform.user4.focus();
return false;
}
}
</script>
<form method="post" action="$path" ENCTYPE="multipart/form-data" name="myform" onsubmit="return chkForm();">
EOT;
}