How to get textbox value in php without clicking submit

Tiis is my Input box <input type=“text”

I want to pass what i typed value to php variable like <a href=“abc.php?id=<?php echo $textbox ;?>”" >

what should i do please help me

thanks & regards,
Darshan N

AJAX call using and event

that one also tried if what result i got through ajax it is not getting outside that calling id

I need more information or more code to understand.

<input type=“text” name=“amount” ///////////////////////// textbox enter amount

<a href=“abc.php?id=textbox value” //////////////////////// i want to fetch what amount what i entered in the above textbox , is this possible…?

If you mean you are passing the value to another page such as abc.php?id=… Then, you just use GET…

In the abc.php code, you “get” the value of id…

$id = $_GET[‘id’];

You should check to make sure it is not blank after you get it.

your’s is right but i want that id value what i typing in the text box

eX: <input type=“text” --------------------->I am typing value as 250

I want in link value

<a href=“abc.php?id= 250

thanks,

Yes, if it is an integer, you do not use quotes.
OR, you can force it to int like this: $id = settype($_GET[‘id’], “integer”);
But, it is simpler to just set it correctly from the start…

It’s pretty basic.

<form method="post">
 <input name="id">
 <input type="submit" value="Submit">
</form>

<?php if ($_POST): ?>
<a href="abc.php?id=<?= $_POST['id'] ?>"><?= $_POST['id'] ?></a>
<?php endif; ?>

thank you    

Sponsor our Newsletter | Privacy Policy | Terms of Service