So, I guess I’m a programmer

Yesterday, I spent six (6) hours chasing down one (1) bug in a web-based program I am writing for work.

Oy.

This is going to get a bit geeky.

I have a form that pulls data for a select box from a MySQL database. Based on what the user chooses in that select (a drop-down box for you non-geeks), a second select needs to be populated from the database. I could pull all the data the first time, and just parse out the appropriate material when the user makes their choice, but it is a lot of data, and it seems like that is not the right way.

Instead, when the user chooses from the first select box, it triggers a javascript function with onChange, and that function actually submits the form using submit(), but not until changing a variable in a hidden field that indicates to the page that the data should not actually be INSERTed into the database. Instead, it uses this second reload of the page to pull the data for the second select.

Only, it wasn't working. The javascript submit() just wouldn't go. I spent six hours trying to debug it, including writing the page over, finding another page online that did much the same thing, and comparing it, stripping out all the extraneous material from my form until it looked like that working form... and then, yesterday at 4:05 pm, I found it.

My form has a submit button. It was coded like this:

<input type="submit" name="submit" value="Add this Client"/>

The form I found that worked, was coded like this:

<input type="submit" name="Submit" value="Add this Client"/>

And this, ladies and gentlemen, is why I don't want to be a programmer.

This entry was posted in Me. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>