ajax question

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

    ajax question

    Hello,

    I have begun working with ajax recently to populate a drop down in a
    form, where prviously the whole page would have to reload. Works great.

    Where the form originally had a standard drop down like this:

    <Select Method="Shippin gMethod">
    <option>method1 </option>
    <option>method2 </option>
    <option>method3 </option>
    </Select>

    It now pulls form an external page and ajax uses

    document.getEle mentById('myspa n').innerHTML = result;

    and puts it here inside my form:

    <form name="form1">
    (stuff snipped)
    <span name="myspan" id="myspan"></span>
    </form>

    All works well in that the form posts properly.

    However, previously there was the following javascript to trigger a
    function when the <Select Method="Shiping Method"was changed:

    <script language="JavaS cript" type="text/JavaScript">
    document.getEle mentsByName("Sh ippingMethod")[0].onchange=total ;
    </SCRIPT>

    This now results in an error:

    document.form1. ShippingMethod is null or not an object

    What do I do about that?
  • Nomen Nescio

    #2
    Re: ajax question

    " <Select Method="Shippin gMethod""


    This is a typo. Should of course be <Select Name="ShippingM ethod">



    One other problem is that there is a validation script that runs to make
    sure someone has selected an option, as the first one in the list is

    <option value="">Please Select</option>


    if (theForm.Shippi ngMethod.value == "")
    {
    alert("Please Select a shipping method.");
    theForm.Shippin gMethod.focus() ;
    return (false);
    }

    This still works with the ajax version in IE but now fails in Mozilla.

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: ajax question

      Alex wrote:
      As stated, the Select Method was a typo.
      Please forgive me for replying one minute before that. I really should have
      asked my crystal ball first, but it is currently under maintenance, you see.
      Also, things were snipped for brevity.
      Very clever. NOT.
      Of course the <formhas an action.
      Post it, then.
      I have done away with
      >
      document.getEle mentsByName("Sh ippingMethod")[0].onchange=total ;
      >
      as you are right it needless. So that problem is solved. The one
      regarding the validation remains.
      PEBKAC. Trust me.
      [Top post]
      You are quoting like a bat. Please stop that. [tm]


      PointedEars
      --
      var bugRiddenCrashP ronePieceOfJunk = (
      navigator.userA gent.indexOf('M SIE 5') != -1
      && navigator.userA gent.indexOf('M ac') != -1
      ) // Plone, register_functi on.js:16

      Comment

      • optimistx

        #4
        Re: ajax question

        MC wrote:
        We can't all be .js experts and worship your greatness oh one of great
        talent.
        >
        Geez, can't you be nice to anybody???? or is it your goal to belittle
        and put down everyone here?
        >
        For me it has been easier not to get upset when I imagine, that any
        irritating person in fact may be sick, suffering from Asperger syndrome,
        ADHD, autism or some other personal disorder. I pretend for myself being a
        physician observing the person and asking myself: is it wise for me to start
        shouting and screaming with red face, kicking chairs and spoiling my day,
        when I have got such a patient to talk with?

        I do not claim any poster here in reality has such disorders. It is my
        imagination only and on purpose. If one has not had the opportunity to live
        with a person having e.g. Asperger syndrome, then it might help to google
        with the word and get astonished. When being extreme cases those people can
        be so astonishing that after some time you might feel they are sympathetic
        in their almost complete inability to understand human feelings. Is it their
        fault if they are sick?




        Comment

        • MC

          #5
          Re: ajax question

          Thank you for the laugh!

          Yes,
          It almost does seem as if he has mental issues. The bitter vile tone of
          messages actually makes me not want the help he provides. Its like buying
          gas, you need it, but you cringe every time you have to get some.


          "optimistx" <optimistxPoist a@poistahotmail .comwrote in message
          news:48b25af9$0 $25401$f4da826c @news.24online. fi...
          MC wrote:
          >We can't all be .js experts and worship your greatness oh one of great
          >talent.
          >>
          >Geez, can't you be nice to anybody???? or is it your goal to belittle
          >and put down everyone here?
          >>
          >
          For me it has been easier not to get upset when I imagine, that any
          irritating person in fact may be sick, suffering from Asperger syndrome,
          ADHD, autism or some other personal disorder. I pretend for myself being a
          physician observing the person and asking myself: is it wise for me to
          start
          shouting and screaming with red face, kicking chairs and spoiling my day,
          when I have got such a patient to talk with?
          >
          I do not claim any poster here in reality has such disorders. It is my
          imagination only and on purpose. If one has not had the opportunity to
          live
          with a person having e.g. Asperger syndrome, then it might help to google
          with the word and get astonished. When being extreme cases those people
          can
          be so astonishing that after some time you might feel they are sympathetic
          in their almost complete inability to understand human feelings. Is it
          their
          fault if they are sick?
          >
          >
          >
          >

          Comment

          • Rozagy, artistic Autistic

            #6
            Re: ajax question

            On Aug 25, 8:10�am, "optimistx" <optimistxPoi.. .@poistahotmail .com>
            wrote:
            MC wrote:
            We can't all be .js experts and worship your greatness oh one of great
            talent.
            >
            Geez, can't you be nice to anybody???? or is it your goal to belittle
            and put down everyone here?
            >
            For me it has been easier not to get upset when I imagine, that any
            irritating person in fact may be sick, suffering fromAspergersyn drome,
            ADHD, autism or some other personal disorder. I pretend for myself being a
            physician observing the person and asking myself: is it wise for me to start
            shouting and screaming with red face, kicking chairs and spoiling my day,
            when I have got such a patient to talk with?
            >
            I do not claim any poster here in reality has such disorders. It is my
            imagination only and on purpose. If one has not had the opportunity to live
            with a person having e.g.Aspergersyn drome, then it might help to google
            with the word and get astonished. When being extreme cases those people can
            be so astonishing that after some time you might feel they are sympathetic
            in their almost complete inability to understand human feelings. Is it their
            fault if they are sick?


            People with Asperger's are NOT irritating.

            People without Asperger's though are highly irritating TO US!!!

            I find this extremelly offensive what the person wrote about
            Asperger's people in such a derogaroty way, but maybe it's not his
            fault, maybe he is just 'diseased' with something called IGNORANCE?

            I think so.

            Roza
            Nadine Stavonina-de Montagnac (rozagy)'s profile on Myspace, the place where people come to connect, discover, and share.


            Autistic, beautiful girl and proud of being ME!

            Comment

            • Rozagy, artistic Autistic

              #7
              Re: ajax question

              On Aug 25, 5:52�pm, "MC" <mica[removethis]@aisus.comwrote :
              Thank you for the laugh!
              >
              Yes,
              It almost does seem as if he has mental issues. The bitter vile tone of
              messages actually makes me not want the help he provides. Its like buying
              gas, you need it, but you cringe every time you have to get some.
              >
              "optimistx" <optimistxPoi.. .@poistahotmail .comwrote in message
              >
              news:48b25af9$0 $25401$f4da826c @news.24online. fi...
              >
              >
              >
              MC wrote:
              We can't all be .js experts and worship your greatness oh one of great
              talent.
              >
              Geez, can't you be nice to anybody???? or is it your goal to belittle
              and put down everyone here?
              >
              For me it has been easier not to get upset when I imagine, that any
              irritating person in fact may be sick, suffering fromAspergersyn drome,
              ADHD, autism or some other personal disorder. I pretend for myself being a
              physician observing the person and asking myself: is it wise for me to
              start
              shouting and screaming with red face, kicking chairs and spoiling my day,
              when I have got such a patient to talk with?
              >
              I do not claim any poster here in reality has such disorders. It is my
              imagination only and on purpose. If one has not had the opportunity to
              live
              with a person having e.g.Aspergersyn drome, then it might help to google
              with the word and get astonished. When being extreme cases those people
              can
              be so astonishing that after some time you might feel they are sympathetic
              in their almost complete inability to understand human feelings. Is it
              their
              fault if they are sick?- Hide quoted text -
              >
              - Show quoted text -


              Yes, Gas, I hear it - coming out of your mouth.

              what do you use to talk then, your big fat a** LOL :-))))))

              Comment

              • Rozagy, artistic Autistic

                #8
                Re: ajax question

                On Aug 25, 8:10�am, "optimistx" <optimistxPoi.. .@poistahotmail .com>
                wrote:
                MC wrote:
                We can't all be .js experts and worship your greatness oh one of great
                talent.
                >
                Geez, can't you be nice to anybody???? or is it your goal to belittle
                and put down everyone here?
                >
                For me it has been easier not to get upset when I imagine, that any
                irritating person in fact may be sick, suffering fromAspergersyn drome,
                ADHD, autism or some other personal disorder. I pretend for myself being a
                physician observing the person and asking myself: is it wise for me to start
                shouting and screaming with red face, kicking chairs and spoiling my day,
                when I have got such a patient to talk with?
                >
                I do not claim any poster here in reality has such disorders. It is my
                imagination only and on purpose. If one has not had the opportunity to live
                with a person having e.g.Aspergersyn drome, then it might help to google
                with the word and get astonished. When being extreme cases those people can
                be so astonishing that after some time you might feel they are sympathetic
                in their almost complete inability to understand human feelings. Is it their
                fault if they are sick?



                THIS is a bunch of crap you wrote here! And your English is awful!

                English is my second language, too but my God, yours is something
                else...

                Comment

                • Thomas 'PointedEars' Lahn

                  #9
                  Re: ajax question

                  Rozagy, artistic Autistic wrote:
                  "optimistx" wrote:
                  >MC wrote:
                  >>[...]
                  >[...]
                  [...]
                  Could the three of you please FOAD? Thanks in advance.


                  PointedEars, f1
                  --
                  Prototype.js was written by people who don't know javascript for people
                  who don't know javascript. People who don't know javascript are not
                  the best source of advice on designing systems that use javascript.
                  -- Richard Cornford, cljs, <f806at$ail$1$8 300dec7@news.de mon.co.uk>

                  Comment

                  • Thomas 'PointedEars' Lahn

                    #10
                    Re: ajax question

                    Sn!pe crossposted mindboggingly stupid:
                    optimistx <optimistxPoist a@poistahotmail .comwrote:
                    >Thomas 'PointedEars' Lahn wrote:
                    >>Rozagy, artistic Autistic wrote:
                    >>>"optimistx " wrote:
                    >>>>MC wrote:
                    >>>>>[...]
                    >>>>[...]
                    >>>[...]
                    >>Could the three of you please FOAD? Thanks in advance.
                    >>>
                    >>>
                    >>PointedEars , f1
                    >Sorry, I will not FOAD. FYI, TPAC because ITIOT is very typical for ASP.
                    >
                    [ahem] 'scuse me, guys; is this article yours?
                    It seems to have crept through a gap in the fence.
                    *plonk*

                    Comment

                    Working...