Page 1 of 1

how to get value form button

Posted: Fri Jul 16, 2010 3:21 am
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

Re: how to get value form button

Posted: Sat Jul 17, 2010 4:43 am
by manojsemwal1
waiting for reply

Re: how to get value form button

Posted: Sat Jul 17, 2010 5:00 am
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>.

Re: how to get value form button

Posted: Sat Jul 17, 2010 5:47 am
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
.

Re: how to get value form button

Posted: Sat Jul 17, 2010 7:27 am
by Bind
I would use javascript event handling for that - ajax if on-the-fly server-side processing is required.

Re: how to get value form button

Posted: Sat Jul 17, 2010 8:13 am
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.

Re: how to get value form button

Posted: Mon Jul 19, 2010 12:10 am
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";
}