{"id":19939200,"url":"https://github.com/zapnap/database_form","last_synced_at":"2025-05-03T14:32:45.801Z","repository":{"id":385157,"uuid":"2441","full_name":"zapnap/database_form","owner":"zapnap","description":"Database Form Page Extension for Radiant CMS","archived":false,"fork":false,"pushed_at":"2009-01-09T19:09:08.000Z","size":94,"stargazers_count":17,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T17:04:22.202Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zapnap.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-03-04T15:25:37.000Z","updated_at":"2019-08-13T13:21:44.000Z","dependencies_parsed_at":"2022-07-07T12:54:52.840Z","dependency_job_id":null,"html_url":"https://github.com/zapnap/database_form","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapnap%2Fdatabase_form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapnap%2Fdatabase_form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapnap%2Fdatabase_form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapnap%2Fdatabase_form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zapnap","download_url":"https://codeload.github.com/zapnap/database_form/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252203433,"owners_count":21710963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T23:45:28.750Z","updated_at":"2025-05-03T14:32:45.470Z","avatar_url":"https://github.com/zapnap.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Database Form Extension for Radiant\r\n\r\nThe Database Form extension enables Radiant users to build form pages that\r\nwill save visitor responses to a database table. Those responses can then\r\nbe exported for consumption in some other application (CRM, etc).\r\n\r\nInstall the extension, run the rake radiant:extensions:database_form:migrate\r\ntask, and the rake radiant:extensions:database_form:update task. These\r\ntasks will add the necessary database table to your Radiant installation\r\nand copy over the JavaScript that's required for client-side validation.\r\n\r\nOnce you've done this, log into the Radiant admin and set the page type\r\nof the page where you'll build the form to DatabaseFormPage. Then create\r\nyour form using tags. Here's an example of usage:\r\n\r\n    \u003cr:database:form name=\"requestinfo\" redirect_to=\"/contact/thank-you\"\u003e\r\n      Name:\u003cbr/\u003e\r\n      \u003cr:database:text name=\"name\"/\u003e\u003cbr/\u003e\r\n      Email:\u003cbr/\u003e\r\n      \u003cr:database:text name=\"email\"/\u003e\u003cbr/\u003e\r\n      Primary Interest:\u003cbr/\u003e\r\n      \u003cr:database:select name=\"primary_interest\"\u003e\r\n        \u003cr:database:option name=\"work\"/\u003e\r\n        \u003cr:database:option name=\"fun!\"/\u003e\r\n      \u003c/r:database:select\u003e\u003cbr/\u003e\r\n      \u003cr:database:submit value=\"Submit\"/\u003e\r\n      \u003cr:database:reset value=\"Reset\"/\u003e\r\n    \u003c/r:database:form\u003e\r\n\r\nAs shown above, you can use the redirect_to attribute to specify where the\r\nvisitor should be redirected to after submitting the form.\r\n\r\nThe entire inventory of tags includes:\r\n\r\n  \u003cr:database:form name=\"\" redirect_to=\"\" validate=\"\"\u003e...\u003c/r:database:form\u003e\r\n  \u003cr:database:text name=\"\" validate=\"\"/\u003e\r\n  \u003cr:database:password name=\"\" validate=\"\"/\u003e\r\n  \u003cr:database:checkbox name=\"\" validate=\"\"/\u003e\r\n  \u003cr:database:hidden name=\"\" validate=\"\"/\u003e\r\n  \u003cr:database:textarea name=\"\" validate=\"\"/\u003e\r\n  \u003cr:database:radio name=\"\" validate=\"\"/\u003e\r\n  \u003cr:database:radiogroup name=\"\" validate=\"\"\u003e...\u003c/r:database:radiogroup\u003e\r\n  \u003cr:database:select name=\"\" validate=\"\"\u003e...\u003c/r:database:select\u003e\r\n  \u003cr:database:option name=\"\"/\u003e\r\n  \u003cr:database:us_states/\u003e\r\n  \u003cr:database:ca_provinces/\u003e\r\n  \u003cr:database:countries/\u003e\r\n  \u003cr:database:submit/\u003e\r\n  \u003cr:database:reset/\u003e\r\n  \r\nNote that most tags support client-side validation. Thanks to Andrew Tetlaw\r\nfor his spiffy Prototype-based validation JavaScript. If you wish to include\r\nvalidation in your form, you must set the validate attribute in the form tag.\r\nYou can then choose from a variety of validation routines for the form\r\nelements, including: required, validate-number, validate-digits, \r\nvalidate-alpha, validate-alphanum, validate-date, validate-email,\r\nvalidate-url, validate-currency-dollar, validate-selection, and\r\nvalidate-one-required. You'll also need to include prototype in your layout,\r\nof course (IMPORTANT; without it validation won't work).\r\n\r\n\u003cr:database:form name=\"contact\" validate=\"true\"\u003e\r\n  \u003cr:database:text name=\"name\" validate=\"required\"/\u003e\r\n  \u003cr:database:text name=\"email\" validate=\"required validate-email\"/\u003e\r\n\u003c/r:database:form\u003e\r\n\r\nIf you care to, you can style these validations using CSS:\r\n\r\ninput.validation-failed, textarea.validation-failed {\r\n        border: 1px solid #900;\r\n        color: #900;\r\n}\r\n.validation-advice {\r\n        margin: 5px 0;\r\n        padding: 5px;\r\n        background-color: #900;\r\n        color: #FFF;\r\n        font-weight: bold;\r\n}\r\n\r\nThe Database Forms extension also adds a tab to Radiant's admin\r\ninterface which can be used to export user form data. You can select\r\nby form name (the name you assigned to a form in its tag) and date\r\nranges. XML is the only supported export format at this time.\r\n\r\nMaybe we'll sexy this up some day and make listings browsable through\r\nthe admin but the most common use case is probably exporting data, and\r\nthat's what we needed at the time, so it is what it is. If you'd like\r\nto extend it, we definitely welcome submissions.\r\n\r\nThis extension is based on the Mailer extension by Matt McCray and \r\n(originally) Sean Cribbs. It was inspired by a post on SuperGloo's blog\r\nhttp://code.supergloo.com/2007/12/12/radiant-cms-database-form-extension\r\nbut should be a bit more flexible than what was described there,\r\nallowing you to add arbitrary forms at will without adding database \r\ntables (model attributes for the FormResponse model are serialized\r\nand stored in a content text area).\r\n\r\nDeveloped by Nick Plante for Ubikorp Internet Services. \r\nTested on Radiant 0.6.4.\r\n\r\nhttp://github.com/zapnap/database_form\r\n\r\nhttp://blog.zerosum.org\r\nhttp://www.ubikorp.com\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzapnap%2Fdatabase_form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzapnap%2Fdatabase_form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzapnap%2Fdatabase_form/lists"}