On Sep 5, 5:02*am, mike_solomon <g...@solomontribe.co.ukwrote:
I have a button
<input type="submit" name="Delete" value="Delete">
This code can not be changed
I want to use Javascript to change the type
I tried:
document.DetailView.Delete.type='button'
This works perfectly in Firefox
But in IE I get the error
Error: Could not get the type property. This command is not supported
How can I do this in a way that works in IE
Just an FYI (the solutions in following posts were spot-on):
My guess is that IE doesn't *itself* implement any of the form
elements,
such as button, input, select, etc. Rather, it uses the underlying
Windows
controls. Those Windows control elements are immutable, so once you've
defined it in IE (by giving it a type and a name), you can't just
change
it to a different type of control simply by changing a property value.
At the time I was studying this, the rumor was that MS was considering
using browser-specific controls, rather than native Windows controls,
for
at least some such elements. But I don't know what happened with that.
This is a total pita -- if you need to change an element from one type
to
another, you need to create a new element, duplicate all the important
properties of the original, like name, id, classes and events, and
then
replace the original with the duplicate. Depending on the complexity
of
your application, this can be a *lot* more difficult than simply
changing
a single property on the original.
--
hj