When I was designing part of Love Your Pet Forever’s administration module, I came up with a simple solution to toggle between select boxes and input elements that would, when toggled on or off, post the value to a single desired location.
You can read the full tutorial at Taming the Wild Wild Web, or view the live demo at flexible philosophy.
August 18th, 2008 at 12:59 pm
Can’t comment at the article itself without logging in.
You say in the article:
However, you never remove the ‘name’ attribute from the select. You are simply adding it to the input field, and passing two values for each ‘name’.
August 18th, 2008 at 3:45 pm
Correct -
but, on page load the name attribute is removed from the select box if it is not set to other. Which demands an edit in the article.
This solution is a very simple, and rather dirty, way to handle the problem. Check out ajaxian.com for improved solutions. I came about writing this after using its basic logic on a much more complex form.