Web Analytics Made Easy -
StatCounter added ajax form fields not processed - CodingForum

Announcement

Collapse
No announcement yet.

added ajax form fields not processed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • added ajax form fields not processed

    I have a form that hits the server to add a dropdown menu according to a previous selection.

    The newly created dropdown is not processed when the form submits.
    Do I need to reload the entire page with the changed form in order to get the info sent in the $_post variable??

    Basically when the page loaded the form dropdown didn't exist.

    This doesn't sound right.

    Help much apppreciated.

  • #2
    See:
    http://codingforum.net/showpost.php?...17&postcount=7

    Comment


    • #3
      Oh, that link leads to a script by Cranford, or do I mean Henley, or perhaps Mike 1385, or possibly ancora, or might even be Mentally Hill. They have all been banned from this forum. I wonder how long 12 Pack Mack will last?

      All the code given in this post has been tested and is intended to address the question asked.
      Unless stated otherwise it is not just a demonstration.

      Comment


      • #4
        12 Pack Mack thanks for your post but I am not sure it is what I need or I simply don't understand it.

        Just to clarify.
        The dropdown is shown successfully on the page.
        It is generated with php and sent back in the ajax response.
        What is preventing it from being parsed in the form submission?

        Comment


        • #5
          Mike H. posts lots of great code on that forum. Better than anything I've seen you post. He always posts a complete document. You never do. That's a real cheap shot, attacking someone on another forum, because you don't like his code. Jeez. You sure are grumpy.

          Beedie:

          I'll bet that your second dropdown isn't within the form tags. Did you look at the code on in that post on the other forum? I'll bet you appended the select element to the body, and didn't place it within the form tags. Or, you used .innerHTML to "build" the options. Go look at Mike H.'s code.

          Comment


          • #6
            beedie - you would perhaps do better to post your query in the AJAX forum. Ask a mod to move the thread over.

            All the code given in this post has been tested and is intended to address the question asked.
            Unless stated otherwise it is not just a demonstration.

            Comment


            • #7
              Originally posted by 12 Pack Mack View Post
              Mike H. posts lots of great code on that forum. Better than anything I've seen you post. He always posts a complete document. You never do. That's a real cheap shot, attacking someone on another forum, because you don't like his code. Jeez. You sure are grumpy.
              Your code is (usually) admirable. But you know perfectly well that you have been banned not just once but several times from this forum for abusive behaviour, but you promptly sign up again with a new user name.

              All the code given in this post has been tested and is intended to address the question asked.
              Unless stated otherwise it is not just a demonstration.

              Comment


              • #8
                I don't know where you get that. I keep a lot of his code. Darn near everything he posts. I'll never keep any of yours. I haven't seen anything useful from you. My goodness, in that "interest calculation" thread, you didn't even use form tags. Even I know better than than. You sound like someone with a chip on his shoulder. Why don't you go to digitalpoint forums and make your silly accusations to him? I don't post here very often, mostly because of you. I visit usually every day, and it never fails, you seem to want to "control" every thread. You just gotta have your way. It's too bad he doesn't post here any more. If you ask me, I think you are the abusive one. Man, anybody who gets all bent because someone posts a link to some guy's code that you don't like has a real problem, IMHO.

                And it was you who insulted some student yesterday, and then told him to go "validate" his code. You even gave him the link to the w3c validator. Man, you'd do well to take your own advice.
                Last edited by 12 Pack Mack; Apr 16, 2009, 01:36 PM.

                Comment


                • #9
                  So you don't deny what I say, then?

                  Considering that as 12 Pack Mack you have only been a member since 31st March you seem to have some pretty strong views. But it is not the code that I don't like - it is the person.

                  All the code given in this post has been tested and is intended to address the question asked.
                  Unless stated otherwise it is not just a demonstration.

                  Comment


                  • #10
                    !2 pack mack
                    The code is within the form tags and is totally ready at the server side.

                    SERVER SIDE:
                    Code:
                    <?php
                    $str is declared earlier
                    $dropdown = '<select name="'.$str.'">';
                    			$dropdown .= '<option value="none">None</option>';
                    			foreach($query->result() as $row) {
                    			$dropdown .= '<option value="'.$row->id.'">'.$row->type.'</option>';
                    			}
                    			$dropdown .= '</select>';
                    			echo $dropdown;
                    ?>
                    Firebug shows this as the response to the ajax call:

                    Code:
                    <select name="screen0"><option value="none">None</option><option value="1">Silver Shimmer</option><option
                     value="2">Foil(Gold)</option><option value="3">Copper Blue</option></select>
                    So the code is correctly inserted into the form in the correct div.


                    Someone just mentioned that the select part should not come with ajax.

                    Also just to clarify firebug see the select name etc. The dropdown is correct on the page. It just doesn't get parsed. did a var_dump on the $_POST and they don't show up.

                    Baffled.

                    Comment


                    • #11
                      Man, get over yourself. I'm not HIM! You got a real control issue. Same for me, about the person, I mean. I already don't like you. Grow up. Get a life, something. If you don't like Mike H., tell him, not me. I gave him a link to this thread. He told me that you are a "control freak," his words, not mine, but I totally agree. He told me all about you. I already knew the way you conduct yourself here, but man, you are the totally abusive one. He's given people a lot of fantastic code, and not once has anybody had any trouble with him. Man, you are one spiteful... You are so full of hatred it's a wonder you don't explode. I post a link to some guy's code that you don't like, and you pitch a fit. Wow.

                      Beedie:

                      I just can't see how that is true, the select being within the form tags, that is.

                      Why not try this, put a button as the last line in the form:


                      Code:
                      <input type="button" value="Test Select" onclick="alert(this.form.screen0.value)">
                      </form>
                      Run the AJAX code, then click that button and see if it alerts a value.
                      Last edited by 12 Pack Mack; Apr 16, 2009, 03:25 PM.

                      Comment


                      • #12
                        No alert comes from that but other form vars do alert

                        Comment


                        • #13
                          See. That select list is not within the form tags. You are probably appending it to the body tag. That won't put it inside the form tags.

                          Comment


                          • #14
                            Many people would see it as an affront and an abuse that a person who has been banned on several occasions and under several identities (including Ancora aka your 'friend' Mike Hill) for abusive behaviour is able to re-join the forum under yet another pseudonym. Are you really claiming that you are or were none of these - not Ancora, not Cranford, not Henley, not Mike 1385?

                            All the code given in this post has been tested and is intended to address the question asked.
                            Unless stated otherwise it is not just a demonstration.

                            Comment


                            • #15
                              12 pack the select is in the form. It is some other weird rule about select apparently


                              solved this by having the select already in the form and the options being loaded,
                              Wasn't an ideal solution as the select name is also dynamic.

                              For some reason you can't load the select part

                              Comment

                              Working...
                              X