{"_id":"57e0ffe5c4711017001cab6d","__v":1,"project":"571f5e8cd8667f0e00a3c498","version":{"_id":"571f5e8cd8667f0e00a3c49b","hasDoc":true,"__v":12,"hasReference":true,"project":"571f5e8cd8667f0e00a3c498","createdAt":"2016-04-26T12:26:52.312Z","releaseDate":"2016-04-26T12:26:52.312Z","categories":["571f5e8cd8667f0e00a3c49c","571f73cfcb4baa0e00d13a80","571f7451cb4baa0e00d13a88","571f7d2720695f3400f38797","571f7fb0ac2a080e0014c661","571f884be54f2d0e003ebb0a","572200c9ecb38d0e00d80ebd","572c301e7c8eff0e00aaa174","57df91b2c6348d0e0020c452","57e104db9ff1e21900a721ab","57fd04caeaa77f19008b8202","5899c7113514ce0f0014da84"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"57e104db9ff1e21900a721ab","__v":0,"version":"571f5e8cd8667f0e00a3c49b","project":"571f5e8cd8667f0e00a3c498","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-20T09:43:55.998Z","from_sync":false,"order":4,"slug":"form-api-jquery-plugin","title":"Form-API"},"user":"5720c075db52d01700f5d1e4","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-20T09:22:45.347Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"With the Form-API you can design a highly individual single- or multi-step donation form for your website just with HTML and Javascript. You don't need knowledge of serverside programming.\n\nWe provide you a mighty Javascript-jQuery-Plugin, that takes over a lot of programming work for you, so you can concentrate on designing an awesome donation form without bothering around with validation and payment processing.\n\nPlease use a current jQuery-version and insert our plugin to your code.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"body\": \"Please use the file directly from our server and **do not** copy it to your own server. This ensures that the plugin is always up to date.\",\n  \"title\": \"Important\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<script src=\\\"path/to/jquery.min.js\\\"></script>\\n<script src=\\\"https://secure.fundraisingbox.com/js/jquery.fundraisingbox.min.js\\\"></script>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nNow there is a new \"fundraisingBoxForm()\"-function you can use:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<form id=\\\"form\\\"></form>\\n<script>\\n$(function() {\\n    myForm = $(\\\"#form\\\").fundraisingBoxForm({\\n        hash: \\\"{your_form_hash}\\\"\\n    });\\n});\\n</script>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Minimal example form\"\n}\n[/block]\nThe following example shows a very simple form to perform a direct debit donation:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n<head>\\n\\t<meta charset=\\\"utf-8\\\">\\n\\t<meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge\\\">\\n\\t<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\\t<title>FundraisingBox Example Form</title>\\n</head>\\n<body>\\n\\t<form id=\\\"form\\\">\\n\\t\\t<label for=\\\"payment_amount\\\">Betrag</label>\\n\\t\\t<input type=\\\"text\\\" id=\\\"payment_amount\\\" name=\\\"payment[amount]\\\">\\n\\t\\t<div class=\\\"error\\\" id=\\\"payment_amount_error\\\"></div>\\n\\t\\t\\n\\t\\t<label for=\\\"payment_salutation\\\">Anrede</label>\\n\\t\\t<select name=\\\"payment[salutation]\\\" id=\\\"payment_salutation\\\">\\n\\t\\t\\t<option value=\\\"\\\" selected=\\\"selected\\\">---</option>\\n\\t\\t\\t<option value=\\\"Mrs.\\\">Frau</option>\\n\\t\\t\\t<option value=\\\"Mr.\\\">Herr</option>\\n\\t\\t</select>\\n\\t\\t<div id=\\\"payment_salutation_error\\\" class=\\\"error\\\"></div>\\n\\t\\t\\n\\t\\t<label for=\\\"payment_first_name\\\">Vorname</label>\\n\\t\\t<input type=\\\"text\\\" id=\\\"payment_first_name\\\" name=\\\"payment[first_name]\\\">\\n\\t\\t<div class=\\\"error\\\" id=\\\"payment_first_name_error\\\"></div>\\n\\t\\t\\n\\t\\t<label for=\\\"payment_last_name\\\">Nachname</label>\\n\\t\\t<input type=\\\"text\\\" id=\\\"payment_last_name\\\" name=\\\"payment[last_name]\\\">\\n\\t\\t<div class=\\\"error\\\" id=\\\"payment_last_name_error\\\"></div>\\n\\t\\t\\n\\t\\t<label for=\\\"payment_bank_account_owner\\\">Kontoinhaber</label>\\n\\t\\t<input type=\\\"text\\\" id=\\\"payment_last_name\\\" name=\\\"payment[bank_account_owner]\\\">\\n\\t\\t<div class=\\\"error\\\" id=\\\"payment_bank_account_owner_error\\\"></div>\\n\\t\\t\\n\\t\\t<label for=\\\"payment_bank_iban\\\">IBAN</label>\\n\\t\\t<input type=\\\"text\\\" id=\\\"payment_last_name\\\" name=\\\"payment[bank_iban]\\\">\\n\\t\\t<div class=\\\"error\\\" id=\\\"payment_bank_iban_error\\\"></div>\\n\\t\\t\\n\\t\\t<input id=\\\"submitButton\\\" type=\\\"submit\\\" value=\\\"jetzt spenden\\\" />\\n\\t\\t\\n\\t\\t<input type=\\\"hidden\\\" name=\\\"payment[payment_method]\\\" value=\\\"sepa_direct_debit\\\" />\\n\\t</form>\\n\\n\\t<script src=\\\"path/to/jquery.min.js\\\"></script>\\n\\t<script src=\\\"https://secure.fundraisingbox.com/js/jquery.fundraisingbox.min.js\\\"></script>\\n\\t<script>\\n\\t\\t$(function() {\\n\\t\\t\\tmyForm = $(\\\"#form\\\").fundraisingBoxForm({\\n\\t\\t\\t\\thash: \\\"{your_form_hash}\\\",\\n\\t\\t\\t\\tsuccessUrl: \\\"https://exampleorga.com/success.html?fbToken=%token%\\\"\\n\\t\\t\\t});\\n\\t\\t});\\n\\t</script>\\n</body>\\n</html>\\n\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nYou can see the form live here: [https://www.fundraisingbox.com/examples/de/mini.html](https://www.fundraisingbox.com/examples/de/mini.html).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Constructor options\"\n}\n[/block]\nThere are several useful options you can use to initialize your form. We recommend to use these options so you don't have to program everything yourself.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Option\",\n    \"h-1\": \"Default\",\n    \"h-2\": \"Descriptiion\",\n    \"0-0\": \"**hash**\",\n    \"0-1\": \"\",\n    \"0-2\": \"**required**: hash of your form\",\n    \"2-0\": \"**nextUrl**\",\n    \"2-1\": \"\\\"\\\"\",\n    \"2-2\": \"**Required for multi-step-form:** if set, the redirect after submit will go to this url\",\n    \"3-0\": \"**successUrl**\",\n    \"3-1\": \"\\\"\\\"\",\n    \"3-2\": \"**Recommended:** If set, the user will be redirected to this page after successful donation, you can use parameters like amount=%amount% etc. to personalize your success page.\",\n    \"4-0\": \"**failureUrl**\",\n    \"4-1\": \"\\\"\\\"\",\n    \"4-2\": \"**Recommended:** If set, the user will be redirected to this page after canceling a redirect payment like PayPal.\",\n    \"5-0\": \"**autoSubmit**\",\n    \"5-1\": \"true\",\n    \"5-2\": \"You can disable the submit-handler if you want to e.g. manipulate or add data before submitting.\",\n    \"6-0\": \"**autoRenderErrors**\",\n    \"6-1\": \"true\",\n    \"6-2\": \"After updateSession() or doPayment(): occured errors will be automatically added to the suitable error-divs if they exist.\",\n    \"7-0\": \"**autoFillValues**\",\n    \"7-1\": \"true\",\n    \"7-2\": \"Currently shown elements are filled with existing values if there is a payment session with already stored data (e.g. for multi-step-form next/back-navigation). See \\\"fillValues()\\\" at [Functions](doc:form-api-functions).\",\n    \"9-0\": \"**autoPayment**\",\n    \"9-1\": \"true\",\n    \"9-2\": \"Call doPayment() if there is no nextUrl set and the session is complete after updateSession().\",\n    \"10-0\": \"**autoRedirect**\",\n    \"10-1\": \"true\",\n    \"10-2\": \"Redirect to nextUrl if set or to payment provider if redirect payment or to successUrl after successful donation .\",\n    \"14-0\": \"**creditCardFieldTemplate**\",\n    \"14-1\": \"\\\"payment_credit_card_owner\\\"\",\n    \"14-2\": \"Credit card number and secure id are special fields within iframes. With this option you can specify an ID of a field, from which font stylings are copied to the iframe-fields.\",\n    \"1-0\": \"**firstUrl**\",\n    \"1-1\": \"\\\"\\\"\",\n    \"1-2\": \"Recommended for multi-step-form: if set, the user will be redirect to this url if user enters a further step directly. Also used to redirect user to first step if user navigates back after successful donation.\",\n    \"8-0\": \"**addSessionHashTo**\",\n    \"8-1\": \"\\\"\\\"\",\n    \"8-2\": \"Selector like \\\".nav a\\\" or jQuery-object. Adds the current session hash to href. See \\\"addSessionHashTo()\\\" at [Functions](doc:form-api-functions).\",\n    \"11-0\": \"**classes**\",\n    \"11-1\": \"null\",\n    \"11-2\": \"You can provide an object with attributes \\\"row\\\", \\\"label\\\", \\\"field-type\\\" and \\\"error\\\" to modify the classes of the default row HTML. See \\\"appendFieldRowsTo()\\\" in [Functions](doc:form-api-functions) for further details.\",\n    \"12-0\": \"**generalErrorElement**\",\n    \"12-1\": \"\\\"\\\"\",\n    \"13-0\": \"**processingIndicatorElement**\",\n    \"13-1\": \"\\\"\\\"\",\n    \"12-2\": \"Because of Ajax-Validation we recommend to show a general error message to the user in the viewport if errors occured. With this option you can specify the selector (e.g. class or ID) of your error message. The element is shown or hidden automatically.\",\n    \"13-2\": \"Because of Ajax-Processing we recommend to show a processing indicator to the user after submitting the form. With this option you can specify the selector (e.g. class or ID) of your indicator. The element is shown or hidden automatically.\"\n  },\n  \"cols\": 3,\n  \"rows\": 15\n}\n[/block]\n#Example for generalErrorElement / processingIndicatorElement\nThe error element is automatically hidden on init and shown if there are errors after submit (if autoRenderErrors is true).\nThe indicator element is automatically hidden on init and shown after submit. It will be hidden again after the processing is done.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Recommendation\",\n  \"body\": \"We strongly recommend to use these features for a better usability for your users.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<form id=\\\"form\\\">\\n  ...\\n  <input type=\\\"submit\\\" value=\\\"Spende jetzt\\\" />\\n  <span class=\\\"processing glyphicon glyphicon-hourglass\\\"></span>\\n  <p id=\\\"errorMsg\\\" class=\\\"bg-danger text-danger\\\">\\n    Es sind leider Fehler aufgetreten, bitte überprüfen Sie Ihre Angaben.<br />\\n    <span id=\\\"global_error\\\"></span>\\n  </p>\\n</form>\\n<script>\\n  ...\\n  $(function() {\\n    myForm = $(\\\"#form\\\").fundraisingBoxForm({\\n      hash: \\\"{your_form_hash}\\\",\\n      generalErrorElement: \\\"#errorMsg\\\",\\n      processingIndicatorElement: \\\".processing\\\"\\n    });\\n\\t});\\n</script>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Functions\"\n}\n[/block]\nThere are several public functions you can use. Please have a look on the [Functions page](doc:form-api-functions).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Events\"\n}\n[/block]\nThere are several events you can handle, if you want to do some manual work. Please have a look on the [Events page](doc:form-api-events).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Exceptions\"\n}\n[/block]\nExceptions are thrown if there is something wrong that prevents the form to work. You should catch and handle the exceptions.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"try\\n{\\n  $(function() {\\n    myForm = $(\\\"#form\\\").fundraisingBoxForm({\\n        hash: \\\"{your_form_hash}\\\"\\n    });\\n\\t});\\n}\\ncatch(err)\\n{\\n  //TODO e.g. show error to user, mail error to your developer\\n  if(err.indexOf(\\\"maintenance\\\") != -1)\\n  {\\n    //... \\n  }\\n}\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n**Possible Exceptions:**\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Error\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"error 101: general error\\nerror 900: general error\",\n    \"0-1\": \"something went wrong, please contact our support\",\n    \"1-0\": \"error 102: not owner\",\n    \"1-1\": \"you are not allowed to use forms\",\n    \"2-0\": \"error 103: inactive\",\n    \"2-1\": \"the selected form is inactive\",\n    \"3-0\": \"error 104: not api owner\",\n    \"3-1\": \"you are not allowed to use the form api\",\n    \"4-0\": \"error 105: no hash\",\n    \"4-1\": \"form hash is missing\",\n    \"5-0\": \"error 106: no config\",\n    \"5-1\": \"no form has been found for the given hash\",\n    \"6-0\": \"error 201: session incomplete\",\n    \"6-1\": \"you can only process complete session with doPayment()\",\n    \"7-0\": \"error 202: session processed\",\n    \"7-1\": \"processed sessions cannot be read or updated\",\n    \"8-0\": \"error 203: session not found\",\n    \"8-1\": \"wrong or no session hash at updateSession\",\n    \"9-0\": \"error 204: session exists already\",\n    \"9-1\": \"hash of existing session used for createSession\",\n    \"10-0\": \"error 404: server error\\nerror 500: server error\",\n    \"10-1\": \"something is wrong with the server\",\n    \"11-0\": \"maintenance: *...translated maintenance message...*\",\n    \"11-1\": \"the FundraisingBox is currently in maintenance mode\"\n  },\n  \"cols\": 2,\n  \"rows\": 12\n}\n[/block]","excerpt":"Form-API","slug":"form-api","type":"basic","title":"Introduction"}

Introduction

Form-API

With the Form-API you can design a highly individual single- or multi-step donation form for your website just with HTML and Javascript. You don't need knowledge of serverside programming. We provide you a mighty Javascript-jQuery-Plugin, that takes over a lot of programming work for you, so you can concentrate on designing an awesome donation form without bothering around with validation and payment processing. Please use a current jQuery-version and insert our plugin to your code. [block:callout] { "type": "danger", "body": "Please use the file directly from our server and **do not** copy it to your own server. This ensures that the plugin is always up to date.", "title": "Important" } [/block] [block:code] { "codes": [ { "code": "<script src=\"path/to/jquery.min.js\"></script>\n<script src=\"https://secure.fundraisingbox.com/js/jquery.fundraisingbox.min.js\"></script>", "language": "html" } ] } [/block] Now there is a new "fundraisingBoxForm()"-function you can use: [block:code] { "codes": [ { "code": "<form id=\"form\"></form>\n<script>\n$(function() {\n myForm = $(\"#form\").fundraisingBoxForm({\n hash: \"{your_form_hash}\"\n });\n});\n</script>", "language": "html" } ] } [/block] [block:api-header] { "type": "basic", "title": "Minimal example form" } [/block] The following example shows a very simple form to perform a direct debit donation: [block:code] { "codes": [ { "code": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"utf-8\">\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t<title>FundraisingBox Example Form</title>\n</head>\n<body>\n\t<form id=\"form\">\n\t\t<label for=\"payment_amount\">Betrag</label>\n\t\t<input type=\"text\" id=\"payment_amount\" name=\"payment[amount]\">\n\t\t<div class=\"error\" id=\"payment_amount_error\"></div>\n\t\t\n\t\t<label for=\"payment_salutation\">Anrede</label>\n\t\t<select name=\"payment[salutation]\" id=\"payment_salutation\">\n\t\t\t<option value=\"\" selected=\"selected\">---</option>\n\t\t\t<option value=\"Mrs.\">Frau</option>\n\t\t\t<option value=\"Mr.\">Herr</option>\n\t\t</select>\n\t\t<div id=\"payment_salutation_error\" class=\"error\"></div>\n\t\t\n\t\t<label for=\"payment_first_name\">Vorname</label>\n\t\t<input type=\"text\" id=\"payment_first_name\" name=\"payment[first_name]\">\n\t\t<div class=\"error\" id=\"payment_first_name_error\"></div>\n\t\t\n\t\t<label for=\"payment_last_name\">Nachname</label>\n\t\t<input type=\"text\" id=\"payment_last_name\" name=\"payment[last_name]\">\n\t\t<div class=\"error\" id=\"payment_last_name_error\"></div>\n\t\t\n\t\t<label for=\"payment_bank_account_owner\">Kontoinhaber</label>\n\t\t<input type=\"text\" id=\"payment_last_name\" name=\"payment[bank_account_owner]\">\n\t\t<div class=\"error\" id=\"payment_bank_account_owner_error\"></div>\n\t\t\n\t\t<label for=\"payment_bank_iban\">IBAN</label>\n\t\t<input type=\"text\" id=\"payment_last_name\" name=\"payment[bank_iban]\">\n\t\t<div class=\"error\" id=\"payment_bank_iban_error\"></div>\n\t\t\n\t\t<input id=\"submitButton\" type=\"submit\" value=\"jetzt spenden\" />\n\t\t\n\t\t<input type=\"hidden\" name=\"payment[payment_method]\" value=\"sepa_direct_debit\" />\n\t</form>\n\n\t<script src=\"path/to/jquery.min.js\"></script>\n\t<script src=\"https://secure.fundraisingbox.com/js/jquery.fundraisingbox.min.js\"></script>\n\t<script>\n\t\t$(function() {\n\t\t\tmyForm = $(\"#form\").fundraisingBoxForm({\n\t\t\t\thash: \"{your_form_hash}\",\n\t\t\t\tsuccessUrl: \"https://exampleorga.com/success.html?fbToken=%token%\"\n\t\t\t});\n\t\t});\n\t</script>\n</body>\n</html>\n", "language": "html" } ] } [/block] You can see the form live here: [https://www.fundraisingbox.com/examples/de/mini.html](https://www.fundraisingbox.com/examples/de/mini.html). [block:api-header] { "type": "basic", "title": "Constructor options" } [/block] There are several useful options you can use to initialize your form. We recommend to use these options so you don't have to program everything yourself. [block:parameters] { "data": { "h-0": "Option", "h-1": "Default", "h-2": "Descriptiion", "0-0": "**hash**", "0-1": "", "0-2": "**required**: hash of your form", "2-0": "**nextUrl**", "2-1": "\"\"", "2-2": "**Required for multi-step-form:** if set, the redirect after submit will go to this url", "3-0": "**successUrl**", "3-1": "\"\"", "3-2": "**Recommended:** If set, the user will be redirected to this page after successful donation, you can use parameters like amount=%amount% etc. to personalize your success page.", "4-0": "**failureUrl**", "4-1": "\"\"", "4-2": "**Recommended:** If set, the user will be redirected to this page after canceling a redirect payment like PayPal.", "5-0": "**autoSubmit**", "5-1": "true", "5-2": "You can disable the submit-handler if you want to e.g. manipulate or add data before submitting.", "6-0": "**autoRenderErrors**", "6-1": "true", "6-2": "After updateSession() or doPayment(): occured errors will be automatically added to the suitable error-divs if they exist.", "7-0": "**autoFillValues**", "7-1": "true", "7-2": "Currently shown elements are filled with existing values if there is a payment session with already stored data (e.g. for multi-step-form next/back-navigation). See \"fillValues()\" at [Functions](doc:form-api-functions).", "9-0": "**autoPayment**", "9-1": "true", "9-2": "Call doPayment() if there is no nextUrl set and the session is complete after updateSession().", "10-0": "**autoRedirect**", "10-1": "true", "10-2": "Redirect to nextUrl if set or to payment provider if redirect payment or to successUrl after successful donation .", "14-0": "**creditCardFieldTemplate**", "14-1": "\"payment_credit_card_owner\"", "14-2": "Credit card number and secure id are special fields within iframes. With this option you can specify an ID of a field, from which font stylings are copied to the iframe-fields.", "1-0": "**firstUrl**", "1-1": "\"\"", "1-2": "Recommended for multi-step-form: if set, the user will be redirect to this url if user enters a further step directly. Also used to redirect user to first step if user navigates back after successful donation.", "8-0": "**addSessionHashTo**", "8-1": "\"\"", "8-2": "Selector like \".nav a\" or jQuery-object. Adds the current session hash to href. See \"addSessionHashTo()\" at [Functions](doc:form-api-functions).", "11-0": "**classes**", "11-1": "null", "11-2": "You can provide an object with attributes \"row\", \"label\", \"field-type\" and \"error\" to modify the classes of the default row HTML. See \"appendFieldRowsTo()\" in [Functions](doc:form-api-functions) for further details.", "12-0": "**generalErrorElement**", "12-1": "\"\"", "13-0": "**processingIndicatorElement**", "13-1": "\"\"", "12-2": "Because of Ajax-Validation we recommend to show a general error message to the user in the viewport if errors occured. With this option you can specify the selector (e.g. class or ID) of your error message. The element is shown or hidden automatically.", "13-2": "Because of Ajax-Processing we recommend to show a processing indicator to the user after submitting the form. With this option you can specify the selector (e.g. class or ID) of your indicator. The element is shown or hidden automatically." }, "cols": 3, "rows": 15 } [/block] #Example for generalErrorElement / processingIndicatorElement The error element is automatically hidden on init and shown if there are errors after submit (if autoRenderErrors is true). The indicator element is automatically hidden on init and shown after submit. It will be hidden again after the processing is done. [block:callout] { "type": "warning", "title": "Recommendation", "body": "We strongly recommend to use these features for a better usability for your users." } [/block] [block:code] { "codes": [ { "code": "<form id=\"form\">\n ...\n <input type=\"submit\" value=\"Spende jetzt\" />\n <span class=\"processing glyphicon glyphicon-hourglass\"></span>\n <p id=\"errorMsg\" class=\"bg-danger text-danger\">\n Es sind leider Fehler aufgetreten, bitte überprüfen Sie Ihre Angaben.<br />\n <span id=\"global_error\"></span>\n </p>\n</form>\n<script>\n ...\n $(function() {\n myForm = $(\"#form\").fundraisingBoxForm({\n hash: \"{your_form_hash}\",\n generalErrorElement: \"#errorMsg\",\n processingIndicatorElement: \".processing\"\n });\n\t});\n</script>", "language": "html" } ] } [/block] [block:api-header] { "type": "basic", "title": "Functions" } [/block] There are several public functions you can use. Please have a look on the [Functions page](doc:form-api-functions). [block:api-header] { "type": "basic", "title": "Events" } [/block] There are several events you can handle, if you want to do some manual work. Please have a look on the [Events page](doc:form-api-events). [block:api-header] { "type": "basic", "title": "Exceptions" } [/block] Exceptions are thrown if there is something wrong that prevents the form to work. You should catch and handle the exceptions. [block:code] { "codes": [ { "code": "try\n{\n $(function() {\n myForm = $(\"#form\").fundraisingBoxForm({\n hash: \"{your_form_hash}\"\n });\n\t});\n}\ncatch(err)\n{\n //TODO e.g. show error to user, mail error to your developer\n if(err.indexOf(\"maintenance\") != -1)\n {\n //... \n }\n}", "language": "javascript" } ] } [/block] **Possible Exceptions:** [block:parameters] { "data": { "h-0": "Error", "h-1": "Description", "0-0": "error 101: general error\nerror 900: general error", "0-1": "something went wrong, please contact our support", "1-0": "error 102: not owner", "1-1": "you are not allowed to use forms", "2-0": "error 103: inactive", "2-1": "the selected form is inactive", "3-0": "error 104: not api owner", "3-1": "you are not allowed to use the form api", "4-0": "error 105: no hash", "4-1": "form hash is missing", "5-0": "error 106: no config", "5-1": "no form has been found for the given hash", "6-0": "error 201: session incomplete", "6-1": "you can only process complete session with doPayment()", "7-0": "error 202: session processed", "7-1": "processed sessions cannot be read or updated", "8-0": "error 203: session not found", "8-1": "wrong or no session hash at updateSession", "9-0": "error 204: session exists already", "9-1": "hash of existing session used for createSession", "10-0": "error 404: server error\nerror 500: server error", "10-1": "something is wrong with the server", "11-0": "maintenance: *...translated maintenance message...*", "11-1": "the FundraisingBox is currently in maintenance mode" }, "cols": 2, "rows": 12 } [/block]