• ttc2003

    (@ttc2003)


    Hi.
    I want my users to fill in a text field with for example “test”.
    If the user clicks the submit button, a new tab has to be opened with URL name = “http://domainname.com/user/test
    Where test is the value from the text field.
    Is this possible and how to make this.

    I already made the following but i am stuck…

    <form action=”action_page.php”>
    Type the code:
    <input type=”text” name=”code” value=”Code”>

    <input type=”submit” value=”Send”>
    </form>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Dejean

    (@aikron)

    Can you use jQuery? If so,
    1- You could change the type of your Send button to “button” instead of “submit”.
    2- Detect the click, change the form’s action attribute and submit the form using the field value:

    jQuery(“#BUTTON”).click(function(){
    jQuery(‘#YOURFORM’).attr(‘action’, “http://domainname.com/user/”+jQuery(&#8220;.CODE”).val()).submit();
    });

    Thread Starter ttc2003

    (@ttc2003)

    I guess i can use Jquery but i don’t know how to make this small piece of code all together and get it working.

    Can you help me out on this?

    THX Freek

    Dejean

    (@aikron)

    Yes certainly!
    Where are you placing this html (form)? In a file directly in the template’s folder? Or in a page in the administrative area?

    Thread Starter ttc2003

    (@ttc2003)

    on a page in admin area.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘HTML submit textfield to url’ is closed to new replies.