3 Replies Latest reply on Feb 14, 2008 1:05 PM by Günter Schenk

    Using Javascript in ADDT forms

    Level 1
      Hi,

      Hope someone can help with this. I've been trying to use several javascripts in a few ADDT dynamic forms with no success. I have never had a problem with these same scripts when using them with plain forms, PHPMaker generated forms and WA forms. I think it has something to do with the fields and input names generated by ADDT.

      For example, I use a time picker script that works great in other forms. The field I want to apply it to is named loadin_<?php echo $cnt1; ?>. Since the javascript accesses this input at run time the field name must be something else? I've tried everything and can't get any javascripts to work on these forms.

      I really appreciate the help form this forum. specially Gunter's! They should change your title to ADDT Genious!

      Any help is much appreciated. I have a feeling that once the secret to getting scripts to work in these forms I'll be able to finish this project on time!
        • 1. Re: Using Javascript in ADDT forms
          Günter Schenk Level 4
          Hi Toni,

          thanks for your nice words, but I´m definitely absolutely far from being an "ADDT genius" :-)

          ------
          The field I want to apply it to is named loadin_. Since the javascript accesses this input at run time the field name must be something else?
          ------

          At runtime the field names get an autoincremental number appended, e.g. loadin_1, loadin_2 etc etc -- you can BTW see all that when loading the page in a browser and looking at its source code.

          ------
          I've tried everything and can't get any javascripts to work on these forms
          ------

          Dunno about the javascripts you´re using, but that´s how the form names are "constructed" by ADDT -- to my mind a javascript would have to reference the form names like ADDT does, means "loadin_", but that´s all I can say about it.

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Using Javascript in ADDT forms
            Level 1
            Thanks Gunther,

            Well, compared to me...you're the genius!

            Actually, I found the anser just as you emailed. All of the scripts I am using look for the form name as opposed to the form ID. When the form was built it didn't have a name just and ID. so, I added the name and everything works! One of them, the fields calculation extension, requires changing the filed names to the run-time incremental values, as you pointed out.

            I have another post here that I was hoping you could help me with. I've got a spry tabbed panel set with 7 tabs. In the 8th tab I want to load another php page with an ADDT form in it. The form that's packaged in the tabset is a booking form with a dropdown to select the buyer. The value of that dropdown is the buyerID, the primary key for the buyer table. I'd like to load the buyer.php page, with a dynamic form for editing the buyer table, and use the value of the dropdown with the buyerD from the form to filter the buyer table and load the record corresponding to the buyerID from the form field.

            I'm thinking I have to pass it a form variable but I can't figure out how, or even if, it can be done. Actually there are 2 more pages with ID fields in the form that I'd like to do the same thing with, so this would really help.

            Expert...Genious....there's a thin line there and it's all greek to me!

            Thanks again for the help,

            Tony Galfano
            • 3. Re: Using Javascript in ADDT forms
              Günter Schenk Level 4
              Hi Tony,

              ---
              One of them, the fields calculation extension, requires changing the filed names to the run-time incremental values, as you pointed out.
              ---

              HA ! :-)

              -----
              I have another post here that I was hoping you could help me with. I've got a spry tabbed panel set with 7 tabs. In the 8th tab I want to load another php page with an ADDT form in it. The form that's packaged in the tabset is a booking form with a dropdown to select the buyer. The value of that dropdown is the buyerID, the primary key for the buyer table. I'd like to load the buyer.php page, with a dynamic form for editing the buyer table, and use the value of the dropdown with the buyerD from the form to filter the buyer table and load the record corresponding to the buyerID from the form field.

              I'm thinking I have to pass it a form variable but I can't figure out how, or even if, it can be done. Actually there are 2 more pages with ID fields in the form that I'd like to do the same thing with, so this would really help
              -----

              I´ll reply to that in your original post

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver