Debt Consolidation - Wordpress Themes - Record Internet Radio with Tags - Debt Consolidation - Debt Consolidation

PDA

View Full Version : Disabled submit issues


sacx13
Mar 30th 2006, 4:45 am
I successfuly write a little javascript code to disable my submit button when is pressed, but I have a issue ... when the button is disabled I cannot get the value sendit by this button. Any suggestions ?

<form action="xxx.php" method="POST" enctype="multipart/form-data" name="form1">
<input type="text" size="64" name="yyy" ><br>
<input type="submit" name="action" value="submit" onclick="return disableInput(this);">

Java script is


function disableInput(input)
{
input.disabled=true;
}

sacx13
Mar 30th 2006, 6:12 am
It appears when you have a input of type submit disabled his value is also blanked. So I found another solution.

I added a input hidden type named validation what we check every time when we click on submit. at first click we change the validation on true and we return false from function.

[CODE]
function disableInput(input)
{

if (input.validation.value=="false")
{
input.validation.value="true";
return true;
}
else
return false;

}
[CODE]

In html code I added a new field of type hidden:
<input type="hidden" name="validation" value="false">
and i changed the variable from disableInput to:
disableInput(form1.document)

Regards
Adrian