Questions : Get submit button value from multiple buttons php2022-10-07T01:16:10+00:00 2022-10-07T01:16:10+00:00 Show
878 I have a dynamic menu inside a form element anycodings_submit code is here
after the menu is generated every menu item anycodings_submit is a submit button of the above form I want anycodings_submit to get input of a single element by name or anycodings_submit id attribute of submit button, and load a anycodings_submit post from database.
so when any input button is pressed the anycodings_submit function display_post() is called. Code of anycodings_submit the function is as follows:-
However, the display_post() method is called anycodings_submit inside a content tag whereas the anycodings_submit display_menu() is called inside another anycodings_submit div. So the problem is I'm unable to get the anycodings_submit id of the to submit button any help will be anycodings_submit appreciated thanks in advance. Total Answers 3 30 Answers 1 : of Get submit button value from multiple buttons phpWhen you click on the submit button you anycodings_dynamic will get all inputs values of the form. Do one thing put this statement anycodings_dynamic print_r($_GET);exit; in display_post() anycodings_dynamic as a first line and see what you get anycodings_dynamic after clicking on submit button. Note: 1. you want to get the value of anycodings_dynamic clicked button then you should use anycodings_dynamic javascript or jQuery and Ajax. 2. You anycodings_dynamic can not get input fields value by fields anycodings_dynamic ID. ex. if we have field <input anycodings_dynamic type="submit" name="page-1" id="page-1" anycodings_dynamic value="page-1"> then we can get its anycodings_dynamic value as:
page-1 is the input field name. 0 2022-10-07T01:16:10+00:00 2022-10-07T01:16:10+00:00Answer Link mRahman 5 Answers 2 : of Get submit button value from multiple buttons phpYou can make 5 different forms for each anycodings_dynamic button and change the action to
Then use $_GET['id'] Also change id='blog_post_id' " to anycodings_dynamic id='$blog_post_id' " 0 2022-10-07T01:16:10+00:00 2022-10-07T01:16:10+00:00Answer Link jidam 4 Answers 3 : of Get submit button value from multiple buttons phpIf I am guessing right what is your anycodings_dynamic difficulty then
0 2022-10-07T01:16:10+00:00 2022-10-07T01:16:10+00:00Answer Link miraj PHP isset() functionPHP isset() function is used to check if a variable has been set or not. PHP isset() function syntax
PHP isset() Example
The output is :
lets another php form example to understand more about isset() function. Here, we are do sum of two values, design php form with two textbox and one button control like :
When we run above php example while first time page load it will show error like below: PHP isset() function exampleIn above code add isset() function code to remove above error while page loading.
The output of isset() function php example is : PHP isset() function exampleHow get value from submit in PHP?Use isset() method in PHP to test the form is submitted successfully or not. In the code, use isset() function to check $_POST['submit'] method.
How do I get form values on submit?To get input values on form submit in React:
Store the values of the input fields in state variables. Set the onSubmit prop on the form element. Access the values of the input fields in your handleSubmit function.
Can a submit button have a value?Submit buttons don't participate in constraint validation; they have no real value to be constrained.
How do you tell which submit button was clicked in PHP?PHP isset() function is used to check if a variable has been set or not. This can be useful to check the submit button is clicked or not. The isset() function will return true or false value. The isset() function returns true if variable is set and not null.
|