Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6185145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:39:41+00:00 2026-05-24T01:39:41+00:00

I have a <form> with an action attribute. I would like to change the

  • 0

I have a <form> with an action attribute.

I would like to change the value of action based on the value of an <input>.

The value is provided by the user. If the value is page1.php, the form will be submitted to page1.php. If the value is page2.php, the form will be submitted to page2.php, and so on.

Right now I’m achieving this using JavaScript, however it doesn’t work on a browser with JavaScript disabled.

Is there any way to make the action non-static without JavaScript?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:39:42+00:00Added an answer on May 24, 2026 at 1:39 am

    If you just want to receive the value on the server side, than using get as the form’s method will work (you end up with page.php?my_var_name=my_var_value).

    If, however, you want to direct the form to a completely different page based on the value of your input, you’ll either have to use JS, or have a “catchall” page on the server side that gets the form and redirects to the final page based on the value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form: <form action=bar.php> <input type=hidden name=foo value=<?php SOME_STUFF(); ?> /> <input
I would like to have a form that can submit to two different action
I have a form action that needs to have its value set from a
I have a few checkboxes that submit and change an attribute's value on my
I have an User model who has_one :preference , but I would like to
I would like to create form based on dynamic parameters that are stored in
i have form action file in another directory but some file send to this
i have a form button in the form,which i need to perform basic action
I have a form which users must fill out and submit. The controller action
I have a Form element: $Form=new Zend_Form; $Form->setAction($this->view->url(array('controller'=>'auth','action'=>'create'),null,true)) ->setMethod('post') ->setAttrib('id','auth-form') ->removeAttrib('enctype'); As can be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.