Getting A Value From A Textbox In The Same Php Form

Jun 19, 2007

My problem is that i want to get a value from a textbox in the same php form and pass it to another page. For example i have this:


echo "<td><input type="text" name="firstName"></td>";
$aname = $_GET('firstName');
echo "<td><input type="button" name="ClickMe" value="Click ME" style="font-size:7pt" onclick="window.addedit.location='newpage.php?&thename='$aname';"></td>";?>

so essentially i want to create a variable and assign the value in the textbox to it and pass it to a new page. I have tried $_GET, $_POST and $_REQUEST and all of them dont work.

I know you can do this really easily with .net or java, it would be just by saying something like $avar = textbox.value or something like that, but in php it seems a LOT more complicated .

View 14 Replies


Delete A Row/entry Form Table In Mysql Using Textbox Form

i am making a simple ticket validation system for my school in the theatre, So we scan all the purchased barcodes from the ticket into the form which then posts the barcode data into insert.php which uploads that number to the database (this process would be done before people get there tickets). So now we need to invalidate the ticket, so we scan the tickets that people bring in for the show and that goes into the deleteform.php which is just a text box and a submit button, and i need to post that to a delete script to take that number out of the database.

More Info:

So here is my form for posting the ticket number/barcode to the insert.php script which uploads the number to mysql database.

<form action="insert.php" method="post">
Ticket Number: <input type="text" name="Ticket_Number" />
<input type="submit" />


View 2 Replies

Textbox In A Form Is Filled

i used isset ... never worked...i did this :

if ($_POST["email"]&&$_POST["username"]&&$_POST["password"]&&$_POST["cpass"])...never worked

what do i do.

View 7 Replies

Add Values In The Previous Textbox And Display The Result In Current Textbox?

I have five textboxes.I need to add the values in all the five textboxes and display the result in the sixth textbox without doing any submit action . if i change the values in these five textboxes it should be reflected in the result textbox.

View 1 Replies

Update Form With Multiple Textbox?

Ok I've managed to populate form with values from db, now I want option to edit those values directly in text boxes on page. I know how to update one text box but don't know how to update all. Each textbox has its own column in db, one is also dropdown.

View 3 Replies

Display The Value Of A Variable To A Form Textbox?

Display the value of a variable in a text box.The value is an integer.So for example :$number1= 1+2;.the above is written between the php tags.The following is found in the <form> tags:<input type="text" name="number" id="number" value="<?php echo $number1; ?>" />when I run the page the textbox is just empty.

View 14 Replies

Link Textbox Value With Href Without Submitting Form

I need to send textbox value linking with href without submitting the form. Here is the code

PHP Code:
<form name="form1" method="post" action="cart.php?action=do&id=<? echo $id; ?>">
<input type="text" style="border:1px solid #8C8B8B;width:60px;height:16px;color:#8C8B8B;padding:1px;font-size:10px;" readonly="readonly" value="<? if(empty($pprice)) echo $product_row['product_price']; else echo $pprice; ?>" id="price" name="price">
<a href="?id=<? echo $id; ?>&imageid=<? echo $nt[id];?>&p=<? $spe=''; echo $spe; ?>" ><img id="<? echo $i; ?>" src="images/<?=$nt[images]?>" width="65" height="45" /></a>

Now what i want to do that when the image is clicked, it should also take the value of 'price' textbox in the same page.

View 5 Replies

HTML Form For File Upload: No Textbox.?

My PHP book gives a template HTML form for uploading a file:

<form action="upload.php" method="post" enctype="multipart/form-data"/>

why the discrepancy exists. Is there a way around it? I'm using XHTML Transitional. No doctype is given in the book. But I doubt that's the issue.The script I'm writing aims to take the file the user chooses, process it, and write the result into another file that doesn't exist yet. I'm asking this question because it would be useful to let the user more easily copy the initial file path/name, paste it into the other field, and just change a part of it.(Also: why the difference between "Browse..." and "Choose File"? I tried manually setting the value of the "userfile" field to "Browse..." but nothing happened. This is less important but I'm curious nonetheless.)

View 2 Replies

Multiple Of Values In Third Textbox Without Submitting Form?

want to made a form in which there is three fields.1.product value suppose 1500.2.number of product:2.3.then want to show multiple of these values in third textbox without submitting form.

View 3 Replies

Write PHP Output Back To Form Textbox

I have a web form composing of textboxs for users to enter numbers into. After they press submit, I have a php script that processes the numbers and now echos back the output onto the page. I would like the php output to "echo" into a textbox of the form. How can I do this?

View 6 Replies

Full HTML Form Textbox Editor

I was wondering if there is a such thing that lets users input text into a html form input box, but when they start a new line or something, it inputs "<p>" when is outputed to php. So that the text that they inputed will look exactly the same on a php's output. Its sort of like this forum's way of inputting text.

View 7 Replies

Code A Form That Has Multiple Textbox Without Refreshing Page Using Ajax?

I am trying to code a form that has multiple textbox without refershing page using ajax, then after each textbox threre will be link called add which POST call the other php called addnew.php. In addnew.php data will we added to database(postgres). But I am geting problem while getting the post variable itself.For testing I added the alert in script. this is my code for form (I will change for multiple textbox once it works fine)

script code

<script type='text/javascript'>
$(window).load(function() {


when page is rendered will have like this.

<textbox1 data> <add button>
<textbox1 data> <add button>
<textbox1 data> <add button>
<textbox10 data> <add button>

what I am trying is

Created each textbox and add button pair inside each form dynamically using for loop. (for testing i created only one pair).Should I have form for every pair? when add is clicked value within textbox (#da) should be send to addnew.php through ajax.

following code is displaying data correctly


but in addnew.php file I am not getting $_POST(['da']). Is that means data is not passed to the file or is there something wrong ajax code and finally can I have multiple form with same id. If not then how i can send the only one textbox data ie just before the add button when form is submitted.

View 3 Replies

Javascript - HTML / It Form - Not Allowing To Make A Space In A Textbox Input

I am trying to make a space in the textboxes after you click [UPLOAD YOUR OWN PHOTO] on [URL] I double checked the code and found nothing that is stopping me from writing a SPACE in my text.

View 2 Replies


i have a textbox named x, i entered some value for eg: i'am a boy: when i print the textbox,it returns i' am a boy, i know the reason for ',but i don't want it.

View 2 Replies

Php Textbox

if you could make a simple textbox into a URL creation thing. i am really not sure how to say this but ill try. for example, if you have a url like this ==> and you want to make an addition to taht url via textbox how would you do that?

View 2 Replies

Textbox's Value Goes ''

My values from my text boxes go blank when i use these dynamic drop downs I found from another site. The drop downs work great but its kinda annoying that the user has to retype the information whenever the drop downs used. Is there a way I can save the content of the text boxes when the page reloads? Code:

View 4 Replies

Textbox Value

i have two textfields text1 and text2. i enter a value in text1 field suppose 2006-1-1 like that so the text2 will have to take the value X2006. Not beyond that. like text2 should not accept less than any value in the year 2006 no 2005 should not be taken. for example i enter value in text1 2000-01-01 date and text2 should accept any character in A-Zand 2000 ex:X2000.

View 2 Replies

Set The Value Of A Textbox?

So I have this empty textboxes in a registrationg page. The user enters some data, hits continue and then there's a confirmation page. If the data is incorrect, the user hits go back to go correct whatever was wrong. However, when he goes back, all the textboxes are empty. So the first thing that comes to my mind is to store the user data in a Session (I have a User class that holds all this data so I store the class in the session). When the user goes back I am able to retrieve the data.I do something like this:

$user = $_SESSION['UserInfo'];
$firstName = $user->FirstName;
$lastName = $user->LastName;

How would I put these variables in a textbox?

View 4 Replies

Getting The Value From A Textbox

i am trying to create a donate page. the hole page is php, there is a textbox that hold the amount value which should be send via hidden input with the url to the the payment gateway. i have tryed many time but it is not working.


View 2 Replies

Get Value Of Textbox?

i only program with i want to ask how can i get value of texbox. i tried to use this but it is error :


<FORM NAME ="form1" METHOD ="POST" ACTION = "lession1.php">
<INPUT TYPE = "TEXT" Name ="username" VALUE ="ten" siz>
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Dang nhap">


the red line cause error. i am using php editor 2.2.

View 8 Replies

How To Add A Textbox

"How to add a textbox in php?"

View 4 Replies

Variable In Textbox?

This is the thing. My textbox:

<INPUT TYPE=text NAME=adresse SIZE=20 class=textbox>

I want the variable "$var" to appear in the textbox.

View 1 Replies

Textbox Formatting

say you've got this textbox that asks for a visitors first name. Is there a way to make the first letter of their name CAPITALIZED even if they typed it in lower-case? (i.e. they type "billyjoe" and I want the output to be "Billyjoe" with a capital B) I've been searching for a while, but haven't been able to come up with anything yet.

View 7 Replies

Generated Textbox

I've got a web forum that has three buttons: next, forward, start. They serve as simple navigation through records of a mySQL database. I've also created a text box with php to display which record they are looking at: PHP Code:

function textbox($the_name,$the_value)
$_output = "<input type='text' name='".$the_name."' value='".$the_value."' maxlength=&#393;' size=&#394;'>
return $_output;
//Generate dynamic textbox
echo textbox('alpha',$number]);

This works great for display the record but I thought, what if I could have the user enter in a record also to this text box. I've got html forms that do just that using POST method, but it would be nice if they could do it right at that textbox. Any ideas?

View 3 Replies

Textbox Is Empty

I am trying to test if the txt box txt_matrl from the previous page has anything in it. It always falls into the loop even if the text box is empty? I tried isset also. Can you see an obvious mistake?

if(($_POST['txt_matrl'])!= " ")
$mtrl = $_POST['txt_matrl'];
if ($strWhereSet == "Yes")
$strWHERE = $strWHERE." AND material like '".$mtrl."'";
$strWHERE = "Where material like '".$mtrl."'";
$strWhereSet = "Yes";


View 4 Replies

Display The Value Of Textbox


query="select from my table";
<select name="job" class="small">'
echo '
<option value="'.$rowc[vacancy_id].'" selected>'.$row2[jobtitle].' </option>'
$sql="select * from mytable2 where vacancy_id=$_POST[job]"
<input type="text" name="contact" value="'.$rowc[contact_id].'">

i want to display the textbox without having POST or reloading the page. how would i pass the value of my dropdown into the textbox without reloading the page so that it will display the value of textbox.

View 3 Replies

Copyrights 2005-15, All rights reserved