• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

dynamic text link

Guest
Oct 26, 2006 Oct 26, 2006

Copy link to clipboard

Copied

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

TOPICS
Advanced techniques

Views

484

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 26, 2006 Oct 26, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 26, 2006 Oct 26, 2006

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 26, 2006 Oct 26, 2006

Copy link to clipboard

Copied

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).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 30, 2006 Oct 30, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 30, 2006 Oct 30, 2006

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation