Old Examples

Here are some Examples how you can use jCryption.
Please look at the FAQ or documentation page for more detailed information.

You can download all examples in the jCryption package.

Simple demo »

This is the standard setup.
You have to adjust nothing if you have a normal HTML form.

Just call jCryption on your form.

$("#normal").jCryption();

demo »

Submit event demo »

If you dont have a “normal” input type=”submit” button, you can select any DOM element with a jQuery selector.

You can even change the event which triggers the form submit.
In this example the form will be submited if you double click the submit link.

$("#noSubmitbutton").jCryption({
	submitTrigger:"#submitButton",
	submitEvent:"dblclick"
});

demo »

Callback demo »

Almost everything that jCryption does has a callback function so you always know the current state.
Most of the callback functions also have the possibility to interrupt the encryption process, for example if you want to check the values and if the input was wrong just return false and the execution will be interrupted.
You can even adjust the speed of the calculations (not recommended because I think it should be as fast as possible).
I set the speed in this example to 300ms that you can see every callback in detail.
I also added a statusbox to display the state.

var $status = $('
<div id="status" style="margin-top:15px;"><img style="margin-right:15px;" title="Loading..." src="loading.gif" alt="Loading..." /></div>
').hide();
var $statusText = $status.find("span");
$("#status_container").append($status);
 
$("#callbackForm").jCryption({
	collectionSpeed:300,
	encryptionSpeed:300,
	beforeEncryption:function() {
		$statusText.text("Loading Keys ...").parent().show();
		return true;
	},
	inputCollectorCallback:function(counter,objectLength) {
		$statusText.text("Collecting Input: "+(counter+1)+" of "+objectLength);
	},
	encryptionCallback:function(counter,objectLength) {
		$statusText.text("Encrypting Status: "+Math.round((counter/objectLength)*100)+"%");
	},
	encryptionFinished:function(encryptedString, objectLength) {
		$statusText.text("Encrypting Status: Completed! submitting Form");
		return true;
	}
});

demo »

Full featured demo »

This example shows what jCryption is capable of.
It also includes a way to implement serverside validation with full protection.

demo »

Fork me on GitHub
Comments (1) Trackbacks (0)
  1. how to use this with jquery.form plugin and jquery.validate plugin

Leave a comment


No trackbacks yet.