Creating Form Variables

forum, I need some help and advice on the last part of a project I am concluding. I am working with updating a database using forms and coldfusion. The way I have things set up, the form will pass selected items from a form element such as a menu, and uses that selected value in SQL to change the database.

Now for one of the records I would like to delete, I will need two variables passed from the form to use within my SQL in my action page. My problem comes that the values I am sending are dynamic and the form element only allows for one value(variable) to be passed. I've been trying to create a variable within my form so that I can pass it along to my action page, but I get an error saying the variable is undefined in my form.

The syntax I've been using includes both to create the variable, and is reassign the variable in the form. Turns out, that either the variable is not being reassigned, or it is not being transfered to the action page.

Heres example code
=================================


.
.
.


Installed Software::--------------------
#SoftwareID# =+= #ComputerName# -- #Title#




================================
my action page that calls the created 'variable' :
================================
.
.
.

SOFTWARE ON COMPUTER NOT REMOVED !!




DELETE
FROM COMPUTERSSOFTWARE
WHERE COMPUTERID = #Form.selectComputerSoftware# AND SOFTWAREID = #Form.variable#


.
.
.
================================

....my thought to pass a created variable is not working. I really need some help with this, if possible. My online searching is not successful and I am coming close to an end. I, somehow, need to give my action page two variables. I even attempted to use a , but apparently, I cannot have this inside cfoutput tags.

Can anyone help me ?!


-=The Best Has Yet To Come=-

Comments

  • Hi
    I assume you are using Cold Fusion?
    I no nothing about Cold Fusion but you should be able to send more than one variable from your form.
    Here is a simple HTML form which returns 2 variables
    if you save it to your hard disk and hiew it in your browser you will see that the address bar will show
    /html_form_action.php?FirstName=Dave&LastName=Mouse
    Using get instead of post passes the variables with the URL.

    Here is the code



    Type your first name:

    Tom
    Bill
    Dave


    Type your last name:





    If you click the "Submit" button, you will send your input to a new page called html_form_action.php.




    Hope this helps
    Regards Davie
  • : Hi
    : I assume you are using Cold Fusion?
    : I no nothing about Cold Fusion but you should be able to send more than one variable from your form.
    : Here is a simple HTML form which returns 2 variables
    : if you save it to your hard disk and hiew it in your browser you will see that the address bar will show
    : /html_form_action.php?FirstName=Dave&LastName=Mouse
    : Using get instead of post passes the variables with the URL.
    :::
    : Hope this helps
    : Regards Davie
    :

    Thanks for responding. I have taken your idea and tried to fit it into what I'm working with. Now you said use the 'get' method for the form, but I still need the 'post' method for my form variables. Now this idea just came to me, to use both but I still did not get it working as expected.



    ...


    My problem here is my coldfusion dynamic assignment of the URL variable. The varName value I want to use won't be defined until once in the form through a query. I need a way to reassign the URL variable before I submit the form using the input submit button.

    Any ideas?

    -=The Best Has Yet To Come=-

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories