Index: trunk/extensions/SemanticForms/libs/SemanticForms.js |
— | — | @@ -321,6 +321,13 @@ |
322 | 322 | // Hide a div due to "show on select". The CSS class is there so that SF can |
323 | 323 | // ignore the div's contents when the form is submitted. |
324 | 324 | function hideDiv(div_id, instanceWrapperDiv) { |
| 325 | + // IDs can't contain spaces, and jQuery won't work with such IDs - if |
| 326 | + // this one has a space, display an alert. |
| 327 | + if ( div_id.indexOf( ' ' ) > -1 ) { |
| 328 | + // TODO - this should probably be a language value, instead of |
| 329 | + // hardcoded in English. |
| 330 | + alert( "Warning: this form has \"show on select\" pointing to an invalid element ID (\"" + div_id + "\") - IDs in HTML cannot contain spaces." ); |
| 331 | + } |
325 | 332 | if (instanceWrapperDiv != null) { |
326 | 333 | instanceWrapperDiv.find('[origID=' + div_id + ']').find("span, div").addClass('hiddenBySF'); |
327 | 334 | instanceWrapperDiv.find('[origID=' + div_id + ']').hide(); |