Hi,
I found a bug when creating or editing a poll node
Steps to generate that bug ::
a) Goto node/add/poll
b) Click on Add another choice button without filling any form values, so validations are fired
c) Now click on save button 2 times
d) you can see the following error on poll/js path
{ "status": true, "data": "\x3cdiv class=\"messages error\"\x3e\n \x3cul\x3e\n
\x3cli\x3eQuestion field is required.\x3c/li\x3e\n \x3cli\x3eYou must fill in
at least two choices.\x3c/li\x3e\n \x3c/ul\x3e\n\x3c/div\x3e\n\x3ctable
class=\"sticky-enabled\"\x3e\n
\x3cthead\x3e\x3ctr\x3e\x3cth\x3eChoice\x3c/th\x3e\x3cth\x3eVote
count\x3c/th\x3e \x3c/tr\x3e\x3c/thead\x3e\n\x3ctbody\x3e\n \x3ctr
class=\"odd\"\x3e\x3ctd class=\"poll-chtext\"\x3e\x3cdiv class=\"form-item\"
id=\"edit-choice-0-chtext-wrapper\"\x3e\n \x3cinput type=\"text\"
maxlength=\"128\" name=\"choice[0][chtext]\" id=\"edit-choice-0-chtext\"
size=\"60\" value=\"\" class=\"form-text error\"
/\x3e\n\x3c/div\x3e\n\x3c/td\x3e\x3ctd class=\"poll-chvotes\"\x3e\x3cdiv
class=\"form-item\" id=\"edit-choice-0-chvotes-wrapper\"\x3e\n \x3cinput
type=\"text\" maxlength=\"7\" name=\"choice[0][chvotes]\" id=\"edit-choice-0-
chvotes\" size=\"5\" value=\"0\" class=\"form-text\"
/\x3e\n\x3c/div\x3e\n\x3c/td\x3e \x3c/tr\x3e\n \x3ctr class=\"even\"\x3e\x3ctd
class=\"poll-chtext\"\x3e\x3cdiv class=\"form-item\" id=\"edit-choice-1-chtext-
wrapper\"\x3e\n \x3cinput type=\"text\" maxlength=\"128\"
name=\"choice[1][chtext]\" id=\"edit-choice-1-chtext\" size=\"60\" value=\"\"
class=\"form-text\" /\x3e\n\x3c/div\x3e\n\x3c/td\x3e\x3ctd class=\"poll-
chvotes\"\x3e\x3cdiv class=\"form-item\" id=\"edit-choice-1-chvotes-
wrapper\"\x3e\n \x3cinput type=\"text\" maxlength=\"7\"
name=\"choice[1][chvotes]\" id=\"edit-choice-1-chvotes\" size=\"5\" value=\"0\"
class=\"form-text\" /\x3e\n\x3c/div\x3e\n\x3c/td\x3e
\x3c/tr\x3e\n\x3c/tbody\x3e\n\x3c/table\x3e\n" }
Well, poll/js is ahah path of "Add another choice" button then why it's called
when we click on "Save" button
Please solve it asap or if anybody has any quick solution to overcome it then
please reply (it's too urgent)
Thanks
Comments
Comment #1
jalpa_bhalara commentedComment #2
pembeci commentedI want to confirm this bug. If the form doesn't validate two times after adding a choice, you get this page which is actually the result of poll_choice_js. This is strange since the clicked button is Save. I'd say somehow #action or #clicked_button is being cached but it appears after the second time Save is clicked. Strange.
Comment #3
pembeci commentedMarking as duplicate of #591696: Problem with various AHAH forms and validation. That one is same as this issue but related to (and marked as duplicate of) #302240: button broken due to fix various problems when using form storage .