5 Replies Latest reply on Oct 30, 2006 3:57 AM by Stefan_K.

    dynamic text link

      Hi i have a list box of NAMES with a value of ID

      what i want is next to the list box 2 links EDIT DELETE

      but these links must have a url of the list bix ID

      i am getting error form is undfined is there a way i can do this

        • 1. Re: dynamic text link
          Assuming that you have debugging on, scroll way down to the bottom of your page and you'll see all the form variables that are alive and well.

          If you see a form variable that contains a value BUT it does not by the time it reaches its destination, you are clearing it out somehow.

          To see where you've lost the value, do something like cfoutput>my value? #theValue# ..cfabort.. <cfoutput ...

          Move this down your page until you see where it goes blank.

          BTW, I always set up cfparam's for every form variable used and then I do not use the word "form.someName" as I found it easier to handle.
          • 2. Re: dynamic text link
            azadisaryev Level 1
            you are referencing #form.PlayerID# in your [edit] and [delete] links, but that value has never been passed to the page. In order for FORM scope variable to be available to you, you have to submit the form. You can't access the FORM scope without submitting the form.
            2 ways you can achieve what you wish:
            a) use javascript in the onclick event of your [edit] and [delete] links to get the selected list entry's value and pass it on to your next page (i.e. as url variable) - if you add an id attribute to your select box, it will be a lot easier to get the selected value...
            b) use a proper form, submit it, then use cflocation to redirect user to either edit or delete page, depending on which button/link was clicked (easier with using buttons instead of links). basically, your form will have the same page as its action page; your [edit] and [delete] links will have to be changes to <input type="submit" ...> with different names (i.e. "editPlayer" and "delPlayer"). then in the top of your page add the form processing code with <cfif isdefined("form.editPlayer")>...<cfelseif isdefined("form.delPlayer")>...</cfif> to send user either to an edit or delete page (with cflocation tag, for example).
            • 3. Re: dynamic text link
              richy2424 Level 1
              Hi thanks

              the form variable is alive, but because but if a user changes the list box the 2 text links are still the old form variable

              thye list box contains users names i want to be able to have a text link EDIT and DELETE

              so the user can select a name from the list box then click either EDIT or DELETE for that user

              how would i use cfparam in this case?
              • 4. Re: dynamic text link
                azadisaryev Level 1
                any changes to the selection by user will NOT be available to CF until you submit the form. you MUST submit the form in order for CF to know which selection was made by user.