Search code examples
drupaldrupal-7drupal-modulesdrupal-webform

Adding a variable on an input in webform


I tried using jQuery, and it adds the title as I instruct, but it doesn't add it to the SOURCE CODE.

jQuery(document).ready(function($){
  $('#ID_to_webform_input').attr('title', 'TEXT SHOWS UP AS TITLE')
});

I am trying to obtain something similar to what shown in this page: Calculating Order Form Totals.

It asks me to add onChange="CalculateTotal(this.form)" to the inputs I want to calculate, but using jQuery in this manner is not doing the job.


Solution

  • Attributes won't be accepted by the webform as input. Try using .val().