Forum Moderators: open
we will offer the possibility to download trial software directly from our site.
What I like to do is :
* when someone wants to download a trial, he gets a form which he has to complete and were the submit button is disabled
* after completing all the fields in the form, the submit buttom must be enabled and the form is submitted to our offices
* folowing the submission the page refreshes to the valid download link for the trial
* this way we can follow up who's downloading the trials.
Thank you for all the help I can get.
Regards,
Karl
...is there a way in html to just disable the send button until all fields are completed? Possibly in java script?
Yes, this could be done with JavaScript. It would essentially have the same effect as validating the form after submission and halting the submission of the form if all fields have not been completed OK - informing the user of what has been missed. I would have said this was the prefered method.
However, any form validation (disabling of submit btn etc.) needs to be backed up by a server-side script that does the final form validation. The JavaScript is only used to create a nice interface for the user in this case. A user can easily disable JavaScript in their browser which will bypass your form validation or even prevent the form from being submitted (if you have disabled the submit btn from the outset). A user could also look at the source and access the link directly.
If you must do it without server-side scripting (using an email address as the form action - yuck) then you simply need form validation code attached to the onsubmit event of the form. If validation is successful, it must open a popup window to initiate the download before submission proceeds. (Actually, since this would require the user's email client to open, it might work without using a popup.)
Without server-side scripting, this will be awful - don't bother!
Kaled.