4 Replies Latest reply on Jun 14, 2013 9:52 AM by the_shocker

    Passing data from a list to form fields

    Chamark425 Level 1

      Using CS3 - Newbie - I have a user request that wants to be able to enter a Client ID field in a Web form field and then click on a button beside that field that will create a pop-up list of clients and their various plans. The user wants to be able to click on a row in that list and transfer the data to the Web form prior to submitting the form.. Wondering if this can be done in DW?  Appreciate some direction or example to see. Thanks in advance for any help.

        • 1. Re: Passing data from a list to form fields
          Level 4

          What have you done so far?

           

          best,

          Shocker

          • 2. Re: Passing data from a list to form fields
            Chamark425 Level 1

            I have created the Web form - created the dynamic table list from an SQL query - I need to be able to pass the client ID that is in the field to the query as a parameter.

            • 3. Re: Passing data from a list to form fields
              Jon Fritz II Adobe Community Professional & MVP

              There's nothing within DW that can do that kind of thing for you. There are no selections or check boxes in the Design View interface that would allow for it.

               

              You could hand-code something like this using  PHP (or another server scripting language) and mySQL (or another database) from within DW though.

               

              If it's time sensitive, I suggest hiring a developer to create the scripting and database. If it's not, PHP and mySQL are what you would need to learn.

               

              EDIT: Looks like you have at least some of that under your belt, someone here should be able to help you.

              • 4. Re: Passing data from a list to form fields
                Level 4

                Use jquery to add a value to a hidden form field upon element click.

                 

                <!DOCTYPE html>

                <html>

                <head>

                <title>jQuery form value replacement when div id is clicked compliments of the_shocker</title>

                <script src="http://code.jquery.com/jquery-latest.min.js" /></script>

                <script type="text/javascript">

                $(document).ready(function(){

                     $('#listid').click(function () {

                          $('#listval').val('some value');

                          $('#listid').hide();

                          $('#submit').show();

                     });

                });

                </script>

                </head>

                <body>

                          <div id="listid">click here</div>

                          <form method="post" action="process.php">

                                    <input type="hidden" id="listval" name="listval" value="" />

                                    <input style="display:none;" id="submit" type="submit" value="submit" />

                          </form>

                </body>

                </html>

                 

                best,

                Shocker