Auto Submit

Discussion in 'ASP General' started by scott, Jul 16, 2005.

  1. scott

    scott Guest

    I have a combo in LISTING 2 that I'm trying to force a sumbit when a user
    makes a change. Can anyone see why it doesn't fire LISTING 2 code?
    It just doesn't do anything. What I'm really trying to do is access the
    value of the combo after a user makes a change. I'm just hardcoding the
    teamID querystring in this example.

    LISTING 1
    -------------
    <script type=text/javascript>

    function showTeams()
    {
    document.addForm.action = "./mypage.asp?teamID=5";
    document.addForm.submit();
    }
    </script>



    LISTING 2
    ------------
    <form action="mypage.asp" method="post" name="addForm">

    <select class="FormTextBox" name="cboCategory"
    onchange="javascript:showTeams();">

    <OPTION value="1">Work Schedule</OPTION>
    <OPTION value="2">Meeting</OPTION>
    <OPTION value="3">Mills</OPTION>
    <OPTION value="5">Teams</OPTION>
    </select>
    scott, Jul 16, 2005
    #1
    1. Advertising

  2. Works fine for me in IE. I suggest, since this is a client-side issue and
    not an ASP one, that you investigate further in a client-side group, such as
    m.p.scripting.jscript.

    Ray at home

    "scott" <> wrote in message
    news:...
    >I have a combo in LISTING 2 that I'm trying to force a sumbit when a user
    >makes a change. Can anyone see why it doesn't fire LISTING 2 code?
    > It just doesn't do anything. What I'm really trying to do is access the
    > value of the combo after a user makes a change. I'm just hardcoding the
    > teamID querystring in this example.
    >
    > LISTING 1
    > -------------
    > <script type=text/javascript>
    >
    > function showTeams()
    > {
    > document.addForm.action = "./mypage.asp?teamID=5";
    > document.addForm.submit();
    > }
    > </script>
    >
    >
    >
    > LISTING 2
    > ------------
    > <form action="mypage.asp" method="post" name="addForm">
    >
    > <select class="FormTextBox" name="cboCategory"
    > onchange="javascript:showTeams();">
    >
    > <OPTION value="1">Work Schedule</OPTION>
    > <OPTION value="2">Meeting</OPTION>
    > <OPTION value="3">Mills</OPTION>
    > <OPTION value="5">Teams</OPTION>
    > </select>
    >
    >
    >
    Ray Costanzo [MVP], Jul 16, 2005
    #2
    1. Advertising

  3. scott

    Bob Lehmann Guest

    Works for me. But, I closed the form </form>.

    Bob Lehmann

    "scott" <> wrote in message
    news:...
    > I have a combo in LISTING 2 that I'm trying to force a sumbit when a user
    > makes a change. Can anyone see why it doesn't fire LISTING 2 code?
    > It just doesn't do anything. What I'm really trying to do is access the
    > value of the combo after a user makes a change. I'm just hardcoding the
    > teamID querystring in this example.
    >
    > LISTING 1
    > -------------
    > <script type=text/javascript>
    >
    > function showTeams()
    > {
    > document.addForm.action = "./mypage.asp?teamID=5";
    > document.addForm.submit();
    > }
    > </script>
    >
    >
    >
    > LISTING 2
    > ------------
    > <form action="mypage.asp" method="post" name="addForm">
    >
    > <select class="FormTextBox" name="cboCategory"
    > onchange="javascript:showTeams();">
    >
    > <OPTION value="1">Work Schedule</OPTION>
    > <OPTION value="2">Meeting</OPTION>
    > <OPTION value="3">Mills</OPTION>
    > <OPTION value="5">Teams</OPTION>
    > </select>
    >
    >
    >
    Bob Lehmann, Jul 16, 2005
    #3
  4. scott

    scott Guest

    OK guys, I found the real problem because my simple submitted version worked
    for me also.

    IThe combo in LISTING 2 fires the Onchange event perfect. However, LISTING 3
    will not fire my ONCHANGE event because I've inserted a "hidden" field after
    the form tag. Now, if I have a hidden form element anywhere inside the form
    tags, onchange won't fire.

    Why would a 'hidden' form element cause a javascript onchange event to not
    work?


    LISTING 1 (WORKS)
    -------------
    <script type=text/javascript>

    function showTeams()
    {
    document.addForm.action = "./mypage.asp?teamID=5";
    document.addForm.submit();
    }
    </script>



    LISTING 2 (WORKS)
    ------------
    <form action="mypage.asp" method="post" name="addForm">

    <select class="FormTextBox" name="cboCategory"
    onchange="javascript:showTeams();">

    <OPTION value="1">Work Schedule</OPTION>
    <OPTION value="2">Meeting</OPTION>
    <OPTION value="3">Mills</OPTION>
    <OPTION value="5">Teams</OPTION>
    </select>


    LISTING 3 (DOESN'T WORK)
    ------------
    <form action="mypage.asp" method="post" name="addForm">

    <select class="FormTextBox" name="cboCategory"
    onchange="javascript:showTeams();">

    <OPTION value="1">Work Schedule</OPTION>
    <OPTION value="2">Meeting</OPTION>
    <OPTION value="3">Mills</OPTION>
    <OPTION value="5">Teams</OPTION>
    </select>




    "Bob Lehmann" <> wrote in message
    news:...
    > Works for me. But, I closed the form </form>.
    >
    > Bob Lehmann
    >
    > "scott" <> wrote in message
    > news:...
    >> I have a combo in LISTING 2 that I'm trying to force a sumbit when a user
    >> makes a change. Can anyone see why it doesn't fire LISTING 2 code?
    >> It just doesn't do anything. What I'm really trying to do is access the
    >> value of the combo after a user makes a change. I'm just hardcoding the
    >> teamID querystring in this example.
    >>
    >> LISTING 1
    >> -------------
    >> <script type=text/javascript>
    >>
    >> function showTeams()
    >> {
    >> document.addForm.action = "./mypage.asp?teamID=5";
    >> document.addForm.submit();
    >> }
    >> </script>
    >>
    >>
    >>
    >> LISTING 2
    >> ------------
    >> <form action="mypage.asp" method="post" name="addForm">
    >>
    >> <select class="FormTextBox" name="cboCategory"
    >> onchange="javascript:showTeams();">
    >>
    >> <OPTION value="1">Work Schedule</OPTION>
    >> <OPTION value="2">Meeting</OPTION>
    >> <OPTION value="3">Mills</OPTION>
    >> <OPTION value="5">Teams</OPTION>
    >> </select>
    >>
    >>
    >>

    >
    >
    scott, Jul 16, 2005
    #4
  5. scott

    scott Guest

    what's the full name of the jscript group?

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:%...
    > Works fine for me in IE. I suggest, since this is a client-side issue and
    > not an ASP one, that you investigate further in a client-side group, such
    > as m.p.scripting.jscript.
    >
    > Ray at home
    >
    > "scott" <> wrote in message
    > news:...
    >>I have a combo in LISTING 2 that I'm trying to force a sumbit when a user
    >>makes a change. Can anyone see why it doesn't fire LISTING 2 code?
    >> It just doesn't do anything. What I'm really trying to do is access the
    >> value of the combo after a user makes a change. I'm just hardcoding the
    >> teamID querystring in this example.
    >>
    >> LISTING 1
    >> -------------
    >> <script type=text/javascript>
    >>
    >> function showTeams()
    >> {
    >> document.addForm.action = "./mypage.asp?teamID=5";
    >> document.addForm.submit();
    >> }
    >> </script>
    >>
    >>
    >>
    >> LISTING 2
    >> ------------
    >> <form action="mypage.asp" method="post" name="addForm">
    >>
    >> <select class="FormTextBox" name="cboCategory"
    >> onchange="javascript:showTeams();">
    >>
    >> <OPTION value="1">Work Schedule</OPTION>
    >> <OPTION value="2">Meeting</OPTION>
    >> <OPTION value="3">Mills</OPTION>
    >> <OPTION value="5">Teams</OPTION>
    >> </select>
    >>
    >>
    >>

    >
    >
    scott, Jul 16, 2005
    #5
  6. scott

    Bob Lehmann Guest

    >> Now, if I have a hidden form element anywhere inside the form tags,
    onchange won't fire.

    Sure it will....

    <form action="mypage.asp" method="post" name="addForm">

    <select class="FormTextBox" name="cboCategory" onchange="showTeams();">

    <OPTION value="1">Work Schedule</OPTION>
    <OPTION value="2">Meeting</OPTION>
    <OPTION value="3">Mills</OPTION>
    <OPTION value="5">Teams</OPTION>
    </select>
    <input type="hidden">
    </form>.

    Listing 3 is identical to Listing 2. When you post to the client-side group
    (microsoft.public.scripting.jscript), include *all* of what you say doesn't
    work.

    Bob Lehmann

    "scott" <> wrote in message
    news:...
    > OK guys, I found the real problem because my simple submitted version

    worked
    > for me also.
    >
    > IThe combo in LISTING 2 fires the Onchange event perfect. However, LISTING

    3
    > will not fire my ONCHANGE event because I've inserted a "hidden" field

    after
    > the form tag. Now, if I have a hidden form element anywhere inside the

    form
    > tags, onchange won't fire.
    >
    > Why would a 'hidden' form element cause a javascript onchange event to not
    > work?
    >
    >
    > LISTING 1 (WORKS)
    > -------------
    > <script type=text/javascript>
    >
    > function showTeams()
    > {
    > document.addForm.action = "./mypage.asp?teamID=5";
    > document.addForm.submit();
    > }
    > </script>
    >
    >
    >
    > LISTING 2 (WORKS)
    > ------------
    > <form action="mypage.asp" method="post" name="addForm">
    >
    > <select class="FormTextBox" name="cboCategory"
    > onchange="javascript:showTeams();">
    >
    > <OPTION value="1">Work Schedule</OPTION>
    > <OPTION value="2">Meeting</OPTION>
    > <OPTION value="3">Mills</OPTION>
    > <OPTION value="5">Teams</OPTION>
    > </select>
    >
    >
    > LISTING 3 (DOESN'T WORK)
    > ------------
    > <form action="mypage.asp" method="post" name="addForm">
    >
    > <select class="FormTextBox" name="cboCategory"
    > onchange="javascript:showTeams();">
    >
    > <OPTION value="1">Work Schedule</OPTION>
    > <OPTION value="2">Meeting</OPTION>
    > <OPTION value="3">Mills</OPTION>
    > <OPTION value="5">Teams</OPTION>
    > </select>
    >
    >
    >
    >
    > "Bob Lehmann" <> wrote in message
    > news:...
    > > Works for me. But, I closed the form </form>.
    > >
    > > Bob Lehmann
    > >
    > > "scott" <> wrote in message
    > > news:...
    > >> I have a combo in LISTING 2 that I'm trying to force a sumbit when a

    user
    > >> makes a change. Can anyone see why it doesn't fire LISTING 2 code?
    > >> It just doesn't do anything. What I'm really trying to do is access the
    > >> value of the combo after a user makes a change. I'm just hardcoding the
    > >> teamID querystring in this example.
    > >>
    > >> LISTING 1
    > >> -------------
    > >> <script type=text/javascript>
    > >>
    > >> function showTeams()
    > >> {
    > >> document.addForm.action = "./mypage.asp?teamID=5";
    > >> document.addForm.submit();
    > >> }
    > >> </script>
    > >>
    > >>
    > >>
    > >> LISTING 2
    > >> ------------
    > >> <form action="mypage.asp" method="post" name="addForm">
    > >>
    > >> <select class="FormTextBox" name="cboCategory"
    > >> onchange="javascript:showTeams();">
    > >>
    > >> <OPTION value="1">Work Schedule</OPTION>
    > >> <OPTION value="2">Meeting</OPTION>
    > >> <OPTION value="3">Mills</OPTION>
    > >> <OPTION value="5">Teams</OPTION>
    > >> </select>
    > >>
    > >>
    > >>

    > >
    > >

    >
    >
    Bob Lehmann, Jul 16, 2005
    #6
  7. scott

    scott Guest

    i will goto jscript group, but just to let you know, the "hidden" form
    element will ONLOY work as you posted, try giving it a name and value and
    the onchange event causes error.


    "Bob Lehmann" <> wrote in message
    news:...
    >>> Now, if I have a hidden form element anywhere inside the form tags,

    > onchange won't fire.
    >
    > Sure it will....
    >
    > <form action="mypage.asp" method="post" name="addForm">
    >
    > <select class="FormTextBox" name="cboCategory" onchange="showTeams();">
    >
    > <OPTION value="1">Work Schedule</OPTION>
    > <OPTION value="2">Meeting</OPTION>
    > <OPTION value="3">Mills</OPTION>
    > <OPTION value="5">Teams</OPTION>
    > </select>
    > <input type="hidden">
    > </form>.
    >
    > Listing 3 is identical to Listing 2. When you post to the client-side
    > group
    > (microsoft.public.scripting.jscript), include *all* of what you say
    > doesn't
    > work.
    >
    > Bob Lehmann
    >
    > "scott" <> wrote in message
    > news:...
    >> OK guys, I found the real problem because my simple submitted version

    > worked
    >> for me also.
    >>
    >> IThe combo in LISTING 2 fires the Onchange event perfect. However,
    >> LISTING

    > 3
    >> will not fire my ONCHANGE event because I've inserted a "hidden" field

    > after
    >> the form tag. Now, if I have a hidden form element anywhere inside the

    > form
    >> tags, onchange won't fire.
    >>
    >> Why would a 'hidden' form element cause a javascript onchange event to
    >> not
    >> work?
    >>
    >>
    >> LISTING 1 (WORKS)
    >> -------------
    >> <script type=text/javascript>
    >>
    >> function showTeams()
    >> {
    >> document.addForm.action = "./mypage.asp?teamID=5";
    >> document.addForm.submit();
    >> }
    >> </script>
    >>
    >>
    >>
    >> LISTING 2 (WORKS)
    >> ------------
    >> <form action="mypage.asp" method="post" name="addForm">
    >>
    >> <select class="FormTextBox" name="cboCategory"
    >> onchange="javascript:showTeams();">
    >>
    >> <OPTION value="1">Work Schedule</OPTION>
    >> <OPTION value="2">Meeting</OPTION>
    >> <OPTION value="3">Mills</OPTION>
    >> <OPTION value="5">Teams</OPTION>
    >> </select>
    >>
    >>
    >> LISTING 3 (DOESN'T WORK)
    >> ------------
    >> <form action="mypage.asp" method="post" name="addForm">
    >>
    >> <select class="FormTextBox" name="cboCategory"
    >> onchange="javascript:showTeams();">
    >>
    >> <OPTION value="1">Work Schedule</OPTION>
    >> <OPTION value="2">Meeting</OPTION>
    >> <OPTION value="3">Mills</OPTION>
    >> <OPTION value="5">Teams</OPTION>
    >> </select>
    >>
    >>
    >>
    >>
    >> "Bob Lehmann" <> wrote in message
    >> news:...
    >> > Works for me. But, I closed the form </form>.
    >> >
    >> > Bob Lehmann
    >> >
    >> > "scott" <> wrote in message
    >> > news:...
    >> >> I have a combo in LISTING 2 that I'm trying to force a sumbit when a

    > user
    >> >> makes a change. Can anyone see why it doesn't fire LISTING 2 code?
    >> >> It just doesn't do anything. What I'm really trying to do is access
    >> >> the
    >> >> value of the combo after a user makes a change. I'm just hardcoding
    >> >> the
    >> >> teamID querystring in this example.
    >> >>
    >> >> LISTING 1
    >> >> -------------
    >> >> <script type=text/javascript>
    >> >>
    >> >> function showTeams()
    >> >> {
    >> >> document.addForm.action = "./mypage.asp?teamID=5";
    >> >> document.addForm.submit();
    >> >> }
    >> >> </script>
    >> >>
    >> >>
    >> >>
    >> >> LISTING 2
    >> >> ------------
    >> >> <form action="mypage.asp" method="post" name="addForm">
    >> >>
    >> >> <select class="FormTextBox" name="cboCategory"
    >> >> onchange="javascript:showTeams();">
    >> >>
    >> >> <OPTION value="1">Work Schedule</OPTION>
    >> >> <OPTION value="2">Meeting</OPTION>
    >> >> <OPTION value="3">Mills</OPTION>
    >> >> <OPTION value="5">Teams</OPTION>
    >> >> </select>
    >> >>
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
    scott, Jul 16, 2005
    #7
  8. scott

    Bob Lehmann Guest

    OK....
    <form action="mypage.asp" method="post" name="addForm">

    <select class="FormTextBox" name="cboCategory" onchange="showTeams();">

    <OPTION value="1">Work Schedule</OPTION>
    <OPTION value="2">Meeting</OPTION>
    <OPTION value="3">Mills</OPTION>
    <OPTION value="5">Teams</OPTION>
    </select>
    <input type="hidden" name="hdn" value="12">
    </form>

    Still works.

    <ot>
    So what error are you getting? Post a *complete* sample of your code.
    </ot>

    Bob Lehmann

    "scott" <> wrote in message
    news:...
    > i will goto jscript group, but just to let you know, the "hidden" form
    > element will ONLOY work as you posted, try giving it a name and value and
    > the onchange event causes error.
    >
    >
    > "Bob Lehmann" <> wrote in message
    > news:...
    > >>> Now, if I have a hidden form element anywhere inside the form tags,

    > > onchange won't fire.
    > >
    > > Sure it will....
    > >
    > > <form action="mypage.asp" method="post" name="addForm">
    > >
    > > <select class="FormTextBox" name="cboCategory" onchange="showTeams();">
    > >
    > > <OPTION value="1">Work Schedule</OPTION>
    > > <OPTION value="2">Meeting</OPTION>
    > > <OPTION value="3">Mills</OPTION>
    > > <OPTION value="5">Teams</OPTION>
    > > </select>
    > > <input type="hidden">
    > > </form>.
    > >
    > > Listing 3 is identical to Listing 2. When you post to the client-side
    > > group
    > > (microsoft.public.scripting.jscript), include *all* of what you say
    > > doesn't
    > > work.
    > >
    > > Bob Lehmann
    > >
    > > "scott" <> wrote in message
    > > news:...
    > >> OK guys, I found the real problem because my simple submitted version

    > > worked
    > >> for me also.
    > >>
    > >> IThe combo in LISTING 2 fires the Onchange event perfect. However,
    > >> LISTING

    > > 3
    > >> will not fire my ONCHANGE event because I've inserted a "hidden" field

    > > after
    > >> the form tag. Now, if I have a hidden form element anywhere inside the

    > > form
    > >> tags, onchange won't fire.
    > >>
    > >> Why would a 'hidden' form element cause a javascript onchange event to
    > >> not
    > >> work?
    > >>
    > >>
    > >> LISTING 1 (WORKS)
    > >> -------------
    > >> <script type=text/javascript>
    > >>
    > >> function showTeams()
    > >> {
    > >> document.addForm.action = "./mypage.asp?teamID=5";
    > >> document.addForm.submit();
    > >> }
    > >> </script>
    > >>
    > >>
    > >>
    > >> LISTING 2 (WORKS)
    > >> ------------
    > >> <form action="mypage.asp" method="post" name="addForm">
    > >>
    > >> <select class="FormTextBox" name="cboCategory"
    > >> onchange="javascript:showTeams();">
    > >>
    > >> <OPTION value="1">Work Schedule</OPTION>
    > >> <OPTION value="2">Meeting</OPTION>
    > >> <OPTION value="3">Mills</OPTION>
    > >> <OPTION value="5">Teams</OPTION>
    > >> </select>
    > >>
    > >>
    > >> LISTING 3 (DOESN'T WORK)
    > >> ------------
    > >> <form action="mypage.asp" method="post" name="addForm">
    > >>
    > >> <select class="FormTextBox" name="cboCategory"
    > >> onchange="javascript:showTeams();">
    > >>
    > >> <OPTION value="1">Work Schedule</OPTION>
    > >> <OPTION value="2">Meeting</OPTION>
    > >> <OPTION value="3">Mills</OPTION>
    > >> <OPTION value="5">Teams</OPTION>
    > >> </select>
    > >>
    > >>
    > >>
    > >>
    > >> "Bob Lehmann" <> wrote in message
    > >> news:...
    > >> > Works for me. But, I closed the form </form>.
    > >> >
    > >> > Bob Lehmann
    > >> >
    > >> > "scott" <> wrote in message
    > >> > news:...
    > >> >> I have a combo in LISTING 2 that I'm trying to force a sumbit when a

    > > user
    > >> >> makes a change. Can anyone see why it doesn't fire LISTING 2 code?
    > >> >> It just doesn't do anything. What I'm really trying to do is access
    > >> >> the
    > >> >> value of the combo after a user makes a change. I'm just hardcoding
    > >> >> the
    > >> >> teamID querystring in this example.
    > >> >>
    > >> >> LISTING 1
    > >> >> -------------
    > >> >> <script type=text/javascript>
    > >> >>
    > >> >> function showTeams()
    > >> >> {
    > >> >> document.addForm.action = "./mypage.asp?teamID=5";
    > >> >> document.addForm.submit();
    > >> >> }
    > >> >> </script>
    > >> >>
    > >> >>
    > >> >>
    > >> >> LISTING 2
    > >> >> ------------
    > >> >> <form action="mypage.asp" method="post" name="addForm">
    > >> >>
    > >> >> <select class="FormTextBox" name="cboCategory"
    > >> >> onchange="javascript:showTeams();">
    > >> >>
    > >> >> <OPTION value="1">Work Schedule</OPTION>
    > >> >> <OPTION value="2">Meeting</OPTION>
    > >> >> <OPTION value="3">Mills</OPTION>
    > >> >> <OPTION value="5">Teams</OPTION>
    > >> >> </select>
    > >> >>
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
    Bob Lehmann, Jul 16, 2005
    #8
  9. scott

    scott Guest

    ERROR: nothing happens, the yellow js error icons says "Object doesn't
    support this property or method"

    Note: If I delete name and value on hidden element, works fine.


    FULL CODE:

    <html>
    <head>
    <title>Calendar Admin</title>

    <link rel="stylesheet" type="text/css" href="library/IntranetStyle01.css">

    <style type="text/css">
    TD {
    font-family:verdana,arial,sans-serif;
    font-size:10pt;
    color:#333366;
    }
    .FormTextBox {
    border:solid 1pt #008080;
    font-family:verdana,sans-serif;
    font-size:10pt;
    color:#000000;
    background-color:#ffffee;
    }

    </style>

    <script type=text/javascript>

    function showTeams()
    {
    document.addForm.action = "combo_test1.asp?action=add&teamID=6";
    document.addForm.submit();
    }
    </script>

    <body>


    <form action="combo_test1.asp" method="post" name="addForm">
    <input type="hidden" name="action" value="add_process">

    <select class="FormTextBox" name="cboCategory"
    onchange="javascript:showTeams();">

    <OPTION value="1">Work Schedule</OPTION>
    <OPTION value="2">Meeting</OPTION>
    <OPTION value="3">Mills</OPTION>
    <OPTION value="5">Teams</OPTION>
    </select>

    </form>
    </body>

    </html>



    "Bob Lehmann" <> wrote in message
    news:%23%...
    > OK....
    > <form action="mypage.asp" method="post" name="addForm">
    >
    > <select class="FormTextBox" name="cboCategory" onchange="showTeams();">
    >
    > <OPTION value="1">Work Schedule</OPTION>
    > <OPTION value="2">Meeting</OPTION>
    > <OPTION value="3">Mills</OPTION>
    > <OPTION value="5">Teams</OPTION>
    > </select>
    > <input type="hidden" name="hdn" value="12">
    > </form>
    >
    > Still works.
    >
    > <ot>
    > So what error are you getting? Post a *complete* sample of your code.
    > </ot>
    >
    > Bob Lehmann
    >
    > "scott" <> wrote in message
    > news:...
    >> i will goto jscript group, but just to let you know, the "hidden" form
    >> element will ONLOY work as you posted, try giving it a name and value and
    >> the onchange event causes error.
    >>
    >>
    >> "Bob Lehmann" <> wrote in message
    >> news:...
    >> >>> Now, if I have a hidden form element anywhere inside the form tags,
    >> > onchange won't fire.
    >> >
    >> > Sure it will....
    >> >
    >> > <form action="mypage.asp" method="post" name="addForm">
    >> >
    >> > <select class="FormTextBox" name="cboCategory" onchange="showTeams();">
    >> >
    >> > <OPTION value="1">Work Schedule</OPTION>
    >> > <OPTION value="2">Meeting</OPTION>
    >> > <OPTION value="3">Mills</OPTION>
    >> > <OPTION value="5">Teams</OPTION>
    >> > </select>
    >> > <input type="hidden">
    >> > </form>.
    >> >
    >> > Listing 3 is identical to Listing 2. When you post to the client-side
    >> > group
    >> > (microsoft.public.scripting.jscript), include *all* of what you say
    >> > doesn't
    >> > work.
    >> >
    >> > Bob Lehmann
    >> >
    >> > "scott" <> wrote in message
    >> > news:...
    >> >> OK guys, I found the real problem because my simple submitted version
    >> > worked
    >> >> for me also.
    >> >>
    >> >> IThe combo in LISTING 2 fires the Onchange event perfect. However,
    >> >> LISTING
    >> > 3
    >> >> will not fire my ONCHANGE event because I've inserted a "hidden" field
    >> > after
    >> >> the form tag. Now, if I have a hidden form element anywhere inside the
    >> > form
    >> >> tags, onchange won't fire.
    >> >>
    >> >> Why would a 'hidden' form element cause a javascript onchange event to
    >> >> not
    >> >> work?
    >> >>
    >> >>
    >> >> LISTING 1 (WORKS)
    >> >> -------------
    >> >> <script type=text/javascript>
    >> >>
    >> >> function showTeams()
    >> >> {
    >> >> document.addForm.action = "./mypage.asp?teamID=5";
    >> >> document.addForm.submit();
    >> >> }
    >> >> </script>
    >> >>
    >> >>
    >> >>
    >> >> LISTING 2 (WORKS)
    >> >> ------------
    >> >> <form action="mypage.asp" method="post" name="addForm">
    >> >>
    >> >> <select class="FormTextBox" name="cboCategory"
    >> >> onchange="javascript:showTeams();">
    >> >>
    >> >> <OPTION value="1">Work Schedule</OPTION>
    >> >> <OPTION value="2">Meeting</OPTION>
    >> >> <OPTION value="3">Mills</OPTION>
    >> >> <OPTION value="5">Teams</OPTION>
    >> >> </select>
    >> >>
    >> >>
    >> >> LISTING 3 (DOESN'T WORK)
    >> >> ------------
    >> >> <form action="mypage.asp" method="post" name="addForm">
    >> >>
    >> >> <select class="FormTextBox" name="cboCategory"
    >> >> onchange="javascript:showTeams();">
    >> >>
    >> >> <OPTION value="1">Work Schedule</OPTION>
    >> >> <OPTION value="2">Meeting</OPTION>
    >> >> <OPTION value="3">Mills</OPTION>
    >> >> <OPTION value="5">Teams</OPTION>
    >> >> </select>
    >> >>
    >> >>
    >> >>
    >> >>
    >> >> "Bob Lehmann" <> wrote in message
    >> >> news:...
    >> >> > Works for me. But, I closed the form </form>.
    >> >> >
    >> >> > Bob Lehmann
    >> >> >
    >> >> > "scott" <> wrote in message
    >> >> > news:...
    >> >> >> I have a combo in LISTING 2 that I'm trying to force a sumbit when
    >> >> >> a
    >> > user
    >> >> >> makes a change. Can anyone see why it doesn't fire LISTING 2 code?
    >> >> >> It just doesn't do anything. What I'm really trying to do is access
    >> >> >> the
    >> >> >> value of the combo after a user makes a change. I'm just hardcoding
    >> >> >> the
    >> >> >> teamID querystring in this example.
    >> >> >>
    >> >> >> LISTING 1
    >> >> >> -------------
    >> >> >> <script type=text/javascript>
    >> >> >>
    >> >> >> function showTeams()
    >> >> >> {
    >> >> >> document.addForm.action = "./mypage.asp?teamID=5";
    >> >> >> document.addForm.submit();
    >> >> >> }
    >> >> >> </script>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >> LISTING 2
    >> >> >> ------------
    >> >> >> <form action="mypage.asp" method="post" name="addForm">
    >> >> >>
    >> >> >> <select class="FormTextBox" name="cboCategory"
    >> >> >> onchange="javascript:showTeams();">
    >> >> >>
    >> >> >> <OPTION value="1">Work Schedule</OPTION>
    >> >> >> <OPTION value="2">Meeting</OPTION>
    >> >> >> <OPTION value="3">Mills</OPTION>
    >> >> >> <OPTION value="5">Teams</OPTION>
    >> >> >> </select>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
    scott, Jul 17, 2005
    #9
  10. scott

    scott Guest

    problem solved, i was using the reserved word "action" as a form element
    name. thanks for all help.


    "Bob Lehmann" <> wrote in message
    news:%23%...
    > OK....
    > <form action="mypage.asp" method="post" name="addForm">
    >
    > <select class="FormTextBox" name="cboCategory" onchange="showTeams();">
    >
    > <OPTION value="1">Work Schedule</OPTION>
    > <OPTION value="2">Meeting</OPTION>
    > <OPTION value="3">Mills</OPTION>
    > <OPTION value="5">Teams</OPTION>
    > </select>
    > <input type="hidden" name="hdn" value="12">
    > </form>
    >
    > Still works.
    >
    > <ot>
    > So what error are you getting? Post a *complete* sample of your code.
    > </ot>
    >
    > Bob Lehmann
    >
    > "scott" <> wrote in message
    > news:...
    >> i will goto jscript group, but just to let you know, the "hidden" form
    >> element will ONLOY work as you posted, try giving it a name and value and
    >> the onchange event causes error.
    >>
    >>
    >> "Bob Lehmann" <> wrote in message
    >> news:...
    >> >>> Now, if I have a hidden form element anywhere inside the form tags,
    >> > onchange won't fire.
    >> >
    >> > Sure it will....
    >> >
    >> > <form action="mypage.asp" method="post" name="addForm">
    >> >
    >> > <select class="FormTextBox" name="cboCategory" onchange="showTeams();">
    >> >
    >> > <OPTION value="1">Work Schedule</OPTION>
    >> > <OPTION value="2">Meeting</OPTION>
    >> > <OPTION value="3">Mills</OPTION>
    >> > <OPTION value="5">Teams</OPTION>
    >> > </select>
    >> > <input type="hidden">
    >> > </form>.
    >> >
    >> > Listing 3 is identical to Listing 2. When you post to the client-side
    >> > group
    >> > (microsoft.public.scripting.jscript), include *all* of what you say
    >> > doesn't
    >> > work.
    >> >
    >> > Bob Lehmann
    >> >
    >> > "scott" <> wrote in message
    >> > news:...
    >> >> OK guys, I found the real problem because my simple submitted version
    >> > worked
    >> >> for me also.
    >> >>
    >> >> IThe combo in LISTING 2 fires the Onchange event perfect. However,
    >> >> LISTING
    >> > 3
    >> >> will not fire my ONCHANGE event because I've inserted a "hidden" field
    >> > after
    >> >> the form tag. Now, if I have a hidden form element anywhere inside the
    >> > form
    >> >> tags, onchange won't fire.
    >> >>
    >> >> Why would a 'hidden' form element cause a javascript onchange event to
    >> >> not
    >> >> work?
    >> >>
    >> >>
    >> >> LISTING 1 (WORKS)
    >> >> -------------
    >> >> <script type=text/javascript>
    >> >>
    >> >> function showTeams()
    >> >> {
    >> >> document.addForm.action = "./mypage.asp?teamID=5";
    >> >> document.addForm.submit();
    >> >> }
    >> >> </script>
    >> >>
    >> >>
    >> >>
    >> >> LISTING 2 (WORKS)
    >> >> ------------
    >> >> <form action="mypage.asp" method="post" name="addForm">
    >> >>
    >> >> <select class="FormTextBox" name="cboCategory"
    >> >> onchange="javascript:showTeams();">
    >> >>
    >> >> <OPTION value="1">Work Schedule</OPTION>
    >> >> <OPTION value="2">Meeting</OPTION>
    >> >> <OPTION value="3">Mills</OPTION>
    >> >> <OPTION value="5">Teams</OPTION>
    >> >> </select>
    >> >>
    >> >>
    >> >> LISTING 3 (DOESN'T WORK)
    >> >> ------------
    >> >> <form action="mypage.asp" method="post" name="addForm">
    >> >>
    >> >> <select class="FormTextBox" name="cboCategory"
    >> >> onchange="javascript:showTeams();">
    >> >>
    >> >> <OPTION value="1">Work Schedule</OPTION>
    >> >> <OPTION value="2">Meeting</OPTION>
    >> >> <OPTION value="3">Mills</OPTION>
    >> >> <OPTION value="5">Teams</OPTION>
    >> >> </select>
    >> >>
    >> >>
    >> >>
    >> >>
    >> >> "Bob Lehmann" <> wrote in message
    >> >> news:...
    >> >> > Works for me. But, I closed the form </form>.
    >> >> >
    >> >> > Bob Lehmann
    >> >> >
    >> >> > "scott" <> wrote in message
    >> >> > news:...
    >> >> >> I have a combo in LISTING 2 that I'm trying to force a sumbit when
    >> >> >> a
    >> > user
    >> >> >> makes a change. Can anyone see why it doesn't fire LISTING 2 code?
    >> >> >> It just doesn't do anything. What I'm really trying to do is access
    >> >> >> the
    >> >> >> value of the combo after a user makes a change. I'm just hardcoding
    >> >> >> the
    >> >> >> teamID querystring in this example.
    >> >> >>
    >> >> >> LISTING 1
    >> >> >> -------------
    >> >> >> <script type=text/javascript>
    >> >> >>
    >> >> >> function showTeams()
    >> >> >> {
    >> >> >> document.addForm.action = "./mypage.asp?teamID=5";
    >> >> >> document.addForm.submit();
    >> >> >> }
    >> >> >> </script>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >> LISTING 2
    >> >> >> ------------
    >> >> >> <form action="mypage.asp" method="post" name="addForm">
    >> >> >>
    >> >> >> <select class="FormTextBox" name="cboCategory"
    >> >> >> onchange="javascript:showTeams();">
    >> >> >>
    >> >> >> <OPTION value="1">Work Schedule</OPTION>
    >> >> >> <OPTION value="2">Meeting</OPTION>
    >> >> >> <OPTION value="3">Mills</OPTION>
    >> >> >> <OPTION value="5">Teams</OPTION>
    >> >> >> </select>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
    scott, Jul 17, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Um9iIEx5bmNo?=

    Stopping auto submit...

    =?Utf-8?B?Um9iIEx5bmNo?=, May 3, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    775
    Ken Cox [Microsoft MVP]
    May 4, 2004
  2. davout
    Replies:
    2
    Views:
    2,071
    davout
    Dec 7, 2004
  3. =?Utf-8?B?V2FyYW4=?=

    Auto-Suggested Textbox like google auto suggest

    =?Utf-8?B?V2FyYW4=?=, Apr 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    8,501
    inrakeshworld
    Jul 27, 2007
  4. ppcguy

    auto form submit on ENTER key

    ppcguy, Aug 6, 2005, in forum: HTML
    Replies:
    4
    Views:
    7,631
    Benjamin Niemann
    Aug 8, 2005
  5. linkswanted
    Replies:
    1
    Views:
    887
Loading...

Share This Page