•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,475 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,237 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2622 | Replies: 2
![]() |
•
•
Join Date: May 2007
Posts: 30
Reputation:
Rep Power: 2
Solved Threads: 2
•
•
•
•
How can I disable the submit button with JAVA Script untill all the mandatory fieleds are filled? if any body can help.. its urgent please
Keep "Submit Button" Disbaled by default.
Then on each mandatory field put
onBlur="function();"
Call the same "function();" on each filed blur.
I hope this is clear.
Cheers...
Looking at my own code of Life and thinking what the hell is this....
------------------------------------
Middle East B2B Marketplace
Dubai Web Design
Dubai SEO
------------------------------------
Middle East B2B Marketplace
Dubai Web Design
Dubai SEO
•
•
Join Date: Apr 2004
Location: Brownsville or Austin, TX or Faber, VA
Posts: 59
Reputation:
Rep Power: 5
Solved Threads: 2
You could try to write a function that will check each field for correctness and then use the form id to submit it with javascript. Instead of having a submit input use a button instead that onclick calls the function.
I think thats right, but the idea is there.
<script type="text/javascript">
function checkThenSubmitForm()
{
<!-- form checking instructions -->;
document.getElementById('theForm').submit();
return true;
}
</script>
<form id="theForm" action="whatever.php" method="post">
<!-- THE INPUT FIELDS -->
<input type="button" value="Submit" onclick="checkThenSubmitForm()"> The purpose of my existence is why I am here.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- How to disable Back button of IE when executing welcome.aspx page? (ASP.NET)
- submit button (JSP)
- VB6 submit button sends information to BBChat (Visual Basic 4 / 5 / 6)
- Submit Button Help (JavaScript / DHTML / AJAX)
- Prevent subsequent submits after initial submit (HTML and CSS)
- Disable the Shut Down Button on the Welcome Screen (Windows tips 'n' tweaks)
Other Threads in the PHP Forum
- Previous Thread: chat system
- Next Thread: loopy doopy


Linear Mode