aspnet form not posting from javascript in Mozilla 1.7

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jack Fox

    aspnet form not posting from javascript in Mozilla 1.7

    The following posts back properlty from an "onclick" in IE, but not in
    Mozilla 1.7. Can anyone explain to me why not? The style class works the
    same in both environments.

    <HEAD>
    <SCRIPT language="JavaS cript">
    function ClickMe(Cat, Nbr, Nav){
    document.forms[0].inCat.value = Cat;
    document.forms[0].inNbr.value=Nb r;
    document.forms[0].inNav.value = Nav;
    __aspnetForm.su bmit();}
    </SCRIPT>
    </HEAD>

    <form name="__aspnetF orm" method="post" action="Default .aspx"
    id="__aspnetFor m">

    ....
    <td valign="top" colspan=2><span class="SeriesNo de"
    onClick="ClickM e('S','12', ' ')">foo</span></td>
    ....

    <input type="hidden" id="inCat" NAME="inCat" value="">
    <input type="hidden" id="inNbr" NAME="inNbr" value="">
    <input type="hidden" id="inNav" NAME="inNav" value="">

    </form>


  • Lasse Reichstein Nielsen

    #2
    Re: aspnet form not posting from javascript in Mozilla 1.7

    "Jack Fox" <jackfox@ix.net com.com> writes:
    [color=blue]
    > The following posts back properlty from an "onclick" in IE, but not in
    > Mozilla 1.7. Can anyone explain to me why not?[/color]

    [color=blue]
    > document.forms[0].inCat.value = Cat;
    > document.forms[0].inNbr.value=Nb r;
    > document.forms[0].inNav.value = Nav;
    > __aspnetForm.su bmit();}[/color]

    Why use both
    document.forms[0]
    and
    __aspnetForm
    to refer to the same form. Personally, I would use
    document.forms['__aspnetForm']
    See <URL: http://jibbering.com/faq/#FAQ4_41 > for explanation.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...