With Webform Javascript Field you can use custom JavaScript or jQuery snippets for your Webform form elements.
Features
- Use custom JavaScript code for all webform components.
- Bundle your helper functions in a custom file and load them for the entire webform.
In addition, you can use a custom Javascript file which bundles all of your helper functions. All you have to do is entering the path to your file (e.g. sites/all/libraries/Calculation/js/formatter.js) on the node edit tab. Now you can simply call the desired function on the component edit page like described above.
Project page
https://drupal.org/sandbox/aprogs/2271743
Automated report by PAReview.sh
http://pareview.sh/pareview/httpgitdrupalorgsandboxaprogs2271743git
Command to clone git repository
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/aprogs/2271743.git webform_javascript_field
Comments
Comment #1
aprogs commentedComment #2
abogomolov commentedPlease move the example into a replacement so translation is clean.
Comment #3
aprogs commentedThank you @abogomolov for reviewing.
Example was moved into a replacement.
Comment #4
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #5
dragonmantank commentedI'd probably argue the point that instead of using
input[name=...]that you should inject the ID of the DOM element. This is a bit cleaner than using the name selector and easier to type. It's nothing major but something to consider.I'd also change
jQueryto$in the examples, since that's how the code is wrapped in the final output. This will ensure that the correct version of jQuery is being referenced. Inexperienced developers will add multiple versions of jQuery and things get weird if you let that scope bubble out of your code. An example of the generated code is here:Comment #6
aprogs commentedHi,
thanks for paying attentions to this application.
I'm using element's name because id of the input element can be changed after the form was submitted (e. g. default id is edit-submitted-sphere but when the form was submitted and rendered with AJAX id will be something like this edit-submitted-sphere--2).
Thanks for the suggestion, I added jQuery alias to the example code.
Also I noticed that context variable is omitted in the behavior, so I added it for AJAX and to meet Drupal standards.
Comment #7
PA robot commentedProject 1: https://drupal.org/node/2211003
Project 2: https://drupal.org/node/2274889
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #8
klausiWhoops, the author change of the other application triggered this. Let's continue there!
Comment #9
PA robot commentedProject 1: https://www.drupal.org/node/2211003
Project 2: https://www.drupal.org/node/2274889
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #10
avpaderno