Closed (fixed)
Project:
Webform
Version:
6.x-2.4
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2009 at 08:51 UTC
Updated:
12 Feb 2009 at 19:40 UTC
Hi all,
I'm using the markup field to insert some javascript to auto-populate a select list.
The problem is that the automatic validation of webforms, won't accept the new values that are inserted.
Is there a way to turn off the automatic validation? Or am I going to have to hack webforms(I've managed to stay away from this so far, so I'd prefer not to)
Thanks in advance for the help.
Comments
Comment #1
alexfisher commentedsubscribe
Comment #2
quicksketchNo, it's not possible to modify a form's HTML through JavaScript (or any other means, like Firebug, or editing the source, etc). Drupal's built-in security mechanisms prevent values from being added to select lists. Alternatively, you can start out with a text field rather than a select list, then convert it to a select list through JavaScript. Since textfields do not have any security checking of values, you can enter any values you like.
Comment #3
quicksketchJust updating title for reference.
Comment #4
Psycnic commentedThanks for the help.
What I decided to do was use javascript to update a hidden field, on change of the select list. And then when the submit button is clicked, reset the value of the select box.
Comment #5
quicksketch