Jump to content


Photo

Getting value of a form object


  • Please log in to reply
4 replies to this topic

#1 shan_cool

shan_cool
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts
  • LocationChennai,India

Posted 27 February 2006 - 11:44 AM

Hi all,

I want to get a value of a text box in a same form.
how can i do it?

can anybody help me?
Thanks,
Shan

#2 chris9902

chris9902
  • Members
  • PipPip
  • Member
  • 14 posts
  • LocationUK

Posted 27 February 2006 - 11:45 AM

[!--quoteo(post=349799:date=Feb 27 2006, 06:44 AM:name=shan_cool)--][div class=\'quotetop\']QUOTE(shan_cool @ Feb 27 2006, 06:44 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hi all,

I want to get a value of a text box in a same form.
how can i do it?

can anybody help me?
Thanks,
Shan
[/quote]

$_POST['text box name here'];

#3 shan_cool

shan_cool
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts
  • LocationChennai,India

Posted 28 February 2006 - 05:20 AM

hi,
Thanks for ur reply,It does not work.

shan


#4 JoeZ

JoeZ
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 28 February 2006 - 05:29 AM

[!--quoteo(post=350145:date=Feb 28 2006, 12:20 AM:name=shan_cool)--][div class=\'quotetop\']QUOTE(shan_cool @ Feb 28 2006, 12:20 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
hi,
Thanks for ur reply,It does not work.

shan
[/quote]

What are you trying to do with it? You have to press submit for PHP to get involved.

Assume the filename is "thisfile.php".
<?php
$name = $_POST['name'];
print $name;
?>
<form action="thisfile.php" method="post"><input name="name"><input type="submit"></form>

This will print what ever you put in the field after you submit it. The page does have to reload.

#5 shan_cool

shan_cool
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts
  • LocationChennai,India

Posted 28 February 2006 - 06:24 AM

Hi,

Thanks for ur reply,here i am not pressing any button,I just want to get the value of the text box which is used in a select query..

Thanks in advance,
shan




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users