By FredAt on
I have created a form where, amongst other things, the user assigns one of four colors. The colors are selected from a SELECt box and assigned a value by typing in #RRGGBB in a text box. When the text box looses focus I use an AHAH to update a visual representation of the color.
All works well. The problem occurs when the user hits the Submit button and the #RRGGBB text box has focus. The AHAH request goes off and form submission occurs pretty much at the same time. The form submit actually works but I get an HTTP 0 error from the AHAH. Is there some way I can stop this from happening?
I'd much appreciate any help.
Comments
I believe this is a result of
I believe this is a result of the following line in misc/ahah.js:
alert(Drupal.ahahError(response, uri));If you remove this line, it should stop this from happening. However, this involves modifying core. The main problem with modifying core is that next time you run an update, this modification will be overwritten. To prevent this from happening, you will either need to remember to remove this line every time you update Drupal, or run some kind of svn setup with vendor branching or whatnot.
As an alternate suggestion, how about using either the Jquery Colorpicker module (shameless plug of my own module), or the Colorpicker module? These both take care of what you are trying to do, and do it in a more visual fashion.
Contact me to contract me for D7 -> D10/11 migrations.
Thank you, Jay. Your
Thank you, Jay. Your diagnosis was right. However is it not worrying that the only way I have of suppressing the issue is to remove an alert that is probably useful on some other occassions?
Using a visual color picker is not an option in my present context.
Yes, it is a little worrying
Yes, it is a little worrying in it's own right. But to tell the truth, I've never seen any other error come up from that line than the one you are getting.
Contact me to contract me for D7 -> D10/11 migrations.