Opened 9 years ago
Closed 9 years ago
#12538 closed defect (fixed)
Can't change select dropdown value
Reported by: | Chris Heller | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | DynamicVariablesPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: |
Description
I'm not sure if this is just something with particular environment configuration, but I was repeatedly getting stuck on not being able to change the value for a dynamic variable. The dropdown was populated properly, but the value would not stick. The form was properly submitted to the server though.
it turns out the problem is in this line
input.val(select.val()); // set hidden text input
The select.val()
portion was always returning undefined for some reason, even when an option was selected. I tested this on a few different browsers and had the same behavior.
Attachments (0)
Change History (6)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
I can't reproduce and the code appears correct. Could you explain a bit more what you mean by the value would not stick? Do you see any errors in the JavaScript console? Do you have any other plugins installed? Which version of Trac are you running?
comment:4 Changed 9 years ago by
Owner: | changed from Rob Guttman to Ryan J Ollos |
---|---|
Status: | new → accepted |
Could you please try the new version of the plugin and report back? The code is simpler now, the performance should be better and it should be easier to debug.
comment:6 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Feel free to follow-up if you continue to have issues.
Here's the diff for what ended up fixing it.
dynvars/templates/dynvars.html
By grabbing the selected option and getting its
value
attribute (.val() doesn't give the correct answer here either) and using that to populate the hidden input field, then things worked.I didn't do any further troubleshooting to determine what was causing the original problem though.