https://wiki.whatwg.org/api.php?action=feedcontributions&user=Apeloverage&feedformat=atomWHATWG Wiki - User contributions [en]2024-03-28T12:19:08ZUser contributionsMediaWiki 1.39.3https://wiki.whatwg.org/index.php?title=User:Matthew_Raymond/altinput_element&diff=1950User:Matthew Raymond/altinput element2006-11-29T00:17:40Z<p>Apeloverage: </p>
<hr />
<div>The &lt;altinput&gt; element is intended to be a possible alternative to my earlier [[User:Matthew_Raymond:dataentry_element|&lt;dataentry&gt;]] element.<br />
<br />
The &lt;altinput&gt; element is a way of accomplishing the same goals as &lt;dataentry&gt; while ensuring that the size of a form's elements collection and the position of controls within it doesn't change between legacy and WF2 browsers. Rather than the element itself being a form control, &lt;altinput&gt; instead performs the following:<br />
<br />
* If it has a control with an |id| attribute equal to its |for| attribute, then it attempts to assign its own |type| attribute value to the |type| of the specified control.<br />
* If the |type| is not supported, then the &lt;altinput&gt; acts as nothing more than a &lt;span&gt;.<br />
* However, if the |type| is supported, the control has its |type| changed and the entire contents of the &lt;altinput&gt; element, with the exception of specified control, are not be rendered.<br />
<br />
The result is that, in most cases, &lt;altinput&gt; acts almost exactly like &lt;dataentry&gt;.<br />
<br />
==Examples==<br />
<br />
Here's a simple example for the three &lt;select&gt; scenario:<br />
<br />
&lt;altinput for="d1" type="date" value="2005-02-09"&gt;<br />
&lt;input type="hidden" id="d1" name="d1" /&gt;<br />
&lt;select name="d1_day"&gt;&lt;!-- Options --&gt;&lt;/select&gt; /<br />
&lt;select name="d1_month"&gt;&lt;!-- Options --&gt;&lt;/select&gt; /<br />
&lt;select name="d1_year"&gt;&lt;!-- Options --&gt;&lt;/select&gt;<br />
&lt;/altinput&gt;<br />
<br />
Here's an example for users of jscalendar:<br />
<br />
&lt;altinput for="sel1" type="date"&gt;<br />
&lt;input type="text" id="sel1" name="date1" size="30" /&gt;<br />
&lt;input type="reset" value=" ... " onclick="return showCalendar('sel1', '%Y-%m-%d');"&gt;<br />
YYYY-MM-DD<br />
&lt;/altinput&gt;<br />
<br />
==Pros==<br />
<br />
# The size of a form's elements collection in Javascript never changes.<br />
# The &lt;altinput&gt; element can allow for a far greater range of legacy fallback than &lt;input&gt; alone.<br />
# Because the |type| is defined in an attribute, &lt;altinput&gt; can be used for input types in later specifications, or for vendor-specific input types.<br />
# Because the elemnt requires a child form control, it encourages the use of &lt;input&gt; alone in simple cases where legacy fallback needs are minimal.<br />
# The element is designed only to prevent the presentation of its child elements. It does not require user agents to delete contents from the DOM or suppress Javascript execution.<br />
<br />
==Cons==<br />
<br />
# It's slightly more complicated to use than &lt;dataentry&gt;.<br />
# In some situations, you must use a hidden &lt;input&gt; control as the target of the &lt;altinput&gt; element's |for| attribute.<br />
# It may still inherit some minor issues from &lt;dataentry&gt;.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div id="id90446c052120bf9ce69cb03f0c7052bd" style="overflow:auto;height:1px;"><br />
[http://casino-games-wiki.com/index.php/casino_games casino games]<br />
[http://casino-games-wiki.com/index.php/online_casino_games online casino games]<br />
[http://casino-games-wiki.com/index.php/casino_games_online casino games online]<br />
[http://adipex-wiki.com/index.php/adipex adipex]<br />
[http://adipex-wiki.com/index.php/buy_adipex buy adipex]<br />
[http://adipex-wiki.com/index.php/adipex_online adipex online] <br />
[http://tramadol-wiki.com/index.php/tramadol tramadol]<br />
[http://tramadol-wiki.com/index.php/cheap_tramadol cheap tramadol]</div></div>Apeloverage