#11 2010-12-05 14:35

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: New web site design

den4b wrote:

Check boxes and radio buttons
Most check boxes are ticked by default and in radio button groups one is selected in all of the tools.

Nice, and solves the problem in case of radio buttons, since now at least one is always enabled. However, in case of checkboxes, while they are all enabled by default, they can be all unchecked and then the same problem can recur (i.e. file uploaded but no result).

This is the sort of JavaScript the Hash and Checksum page needs:

Inside <head> </head>, add

<script language="JavaScript">
<!--
function validate()
{
   if(!document.getElementById("crc32").checked &&
      !document.getElementById("md5").checked &&
      !document.getElementById("sha1").checked)
      document.getElementById("submit").disabled = true;
   else
      document.getElementById("submit").disabled = false;
}
-->
</script>

Change

<input type="checkbox" name="tool[methods][]" value="crc32"
   checked="checked"/>CRC32
<input type="checkbox" name="tool[methods][]" value="md5"
   checked="checked"/>MD5
<input type="checkbox" name="tool[methods][]" value="sha1"
   checked="checked"/>SHA1

to

<input type="checkbox" name="tool[methods][]" id="crc32" value="crc32"
   checked="checked" onClick="validate()"/>CRC32
<input type="checkbox" name="tool[methods][]" id="md5" value="md5"
   checked="checked" onClick="validate()"/>MD5
<input type="checkbox" name="tool[methods][]" id="sha1" value="sha1"
   checked="checked" onClick="validate()"/>SHA1

(i.e. add IDs for each checkbox and also a call to the validate() method).

And finally, change

<input type="submit" value="Calculate"/>

to

<input type="submit" id="submit" value="Calculate"/>

(i.e. add an ID for the submit button as well).

That should do it!

Also, it would be nice if the page displayed the file name in bold of the file that the user uploaded.

den4b wrote:

P.S. Even though the new site is live, it is still under development. Give it some time and it will get better wink

Of course, that's why I'm making these comments, to help make the site better! big_smile

Offline

#12 2010-12-05 15:53

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: New web site design

Most tools are now doing a javascript check on all of the required fields at the form submission stage.

Also, uploaded filename is displayed in the tools which support it.

Offline

#13 2010-12-06 15:03

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: New web site design

cool

Offline

Board footer

Powered by FluxBB