Jump to content

How can I?


Pezmc

Recommended Posts

How can I after five seconds enable a submit button in a form?

This is how far i got
[code]<script language="javascript">

function enableField()
{
document.form1.Submit.disabled=false;
}

</script>
<form name="form1" method="post" action="">
  yer
    <input type="submit" disabled="true" name="Submit" value="Submit">
</form>[/code]

Help appreciated!
Link to comment
https://forums.phpfreaks.com/topic/32112-how-can-i/
Share on other sites

You just use setTimeout()

So:
[code]
<script language="javascript">
<!-- //

var timer = setTimeout("document.form1.Submit.disabled = false",5000)

// -->
</script>
<form name="form1" method="post" action="">
  yer
    <input type="submit" name="Submit" value="Submit">
</form>
[/code]

Hope it helps.
Link to comment
https://forums.phpfreaks.com/topic/32112-how-can-i/#findComment-149210
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.