views:

56

answers:

3

I need to take a user-entered value from a form-field and append it as a URL parameter when the user hits {ENTER} or clicks the submit button. I'm new to DreamWeaver CS5, and I have a project that I'm getting pressure to complete.

+3  A: 
Al Everett
Additionally, if the OP has control of the action page, they could use structAppend() to add the contents of the form scope to the url scope.
Ben Doom
Good point. I'll amend my answer.
Al Everett
+1  A: 

Like @Al Everett said,

Only need to change method = "get" instead of "post" in form attribute.

ppshein
A: 

Your simple HTML code should look like:

<html>
    <head></head>
    <body>
        <cfif structKeyExists(form,"submit")> <!--- To ckeck if form is submiited --->
            <cfoutput>Value = #url.mytextbox#</cfoutput>
        </cfif>
        <form name="myform" method="get" action=""> <!--- action is blank to submit on same page --->
            <input type="text" name="mytextbox" />
            <input type="submit" name="submit" value="submit">
        </form>
    </body>
</html>
Vikas
I know I'm paranoid, but Please use #htmlEditFormat(url.mytextbox)# :)
Henry
But it's okay if designer starts moving on ColdFusion!
Vikas
"submit" won't exist in the FORM scope if you've used action="get". It'll also be in the URL scope.
Al Everett