how to get value form button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

how to get value form button

Post by manojsemwal1 »

when i click on submit button:
then it displayed abc if i use <input type='button' name='edit' value="submit"> then its display nothing why?
l
like:

<input type='submit' name='edit' value='Submit'>
if i put
if(isset($_POST['edit']))
{
echo "abc";
}

or give another solution:



Thanks
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

Re: how to get value form button

Post by manojsemwal1 »

waiting for reply
pbs
Forum Contributor
Posts: 230
Joined: Fri Nov 07, 2008 5:31 am
Location: Nashik, India
Contact:

Re: how to get value form button

Post by pbs »

You will not get value from button if its type="button". Only type="Submit" will submit the form. Also you need to have <form>.
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

Re: how to get value form button

Post by manojsemwal1 »

Thanks for your reply
actually iam using of Image button like <input type="image" src='a.jpg' name=j>
and i have some event handler like Check user uncheck user edit etc. so i want when userclick on image button that time i want to know which button has user pressed for further processing
.
Bind
Forum Contributor
Posts: 102
Joined: Wed Feb 03, 2010 1:22 am

Re: how to get value form button

Post by Bind »

I would use javascript event handling for that - ajax if on-the-fly server-side processing is required.
markjames283
Forum Newbie
Posts: 1
Joined: Sat Jul 17, 2010 8:06 am

Re: how to get value form button

Post by markjames283 »

Assalam Aalkam
Sir,
i m new designer in HTML and PHP sir i m very confused then i m scripts attached in PHP . because i m not understand the video scripts on webpage so please give me a proper solution in my scripts the video link in webpage.
pbs
Forum Contributor
Posts: 230
Joined: Fri Nov 07, 2008 5:31 am
Location: Nashik, India
Contact:

Re: how to get value form button

Post by pbs »

You can submit form using onclick event on images, then you php code will be like this

Code: Select all

if  (isset($_POST['edit_x']))
{
echo "abc";
}
Post Reply