473,287 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

help on taking textbox value without using a <form>

for instance i do have this element but i dont have a <form>:
<input type="Text" name="myname" id="myname" size="30"...>

then i have this link:
echo'<a href="mypage.php?name='.$myname.'...>Save</a>';

i want that $myname will the value of myname textbox. something like
this:
$myname= <the value of the textbox>

then on the side of mypage.php it will catch the values on same
manner:
$myname=$_GET['myname'];
..
..
..
i know this can be easily using <form>...</form>. but if i dont want
to use a for will it be possible? incase it is, how get the value of
the textbox and assign it to $myname variable?

May 16 '07 #1
5 13813
On May 15, 9:50 pm, shotokan99 <soft_devj...@yahoo.comwrote:
for instance i do have this element but i dont have a <form>:
<input type="Text" name="myname" id="myname" size="30"...>

then i have this link:
echo'<a href="mypage.php?name='.$myname.'...>Save</a>';

i want that $myname will the value of myname textbox. something like
this:
$myname= <the value of the textbox>

then on the side of mypage.php it will catch the values on same
manner:
$myname=$_GET['myname'];
.
.
.

i know this can be easily using <form>...</form>. but if i dont want
to use a for will it be possible? incase it is, how get the value of
the textbox and assign it to $myname variable?
I'm a little too tired to figure out exactly what you're looking to
do, but through the fog I think the answer is JavaScript. JavaScript
can read the value of any input field with an ID, and you can use it
to modify the href property of a link you have somewhere, I think. I
know I've used JavaScript, for example, to change the target value of
a form based on one of the form's inputs before sending. Something
along those lines.

Ricky

May 16 '07 #2
ah ok sorry for the inconvenience...let me try to explain it clearly.
usually if we have this:

<form name=".." method="post" action="my.php">
<input type="Text" name="myname" id="myname" size="30"...<Br>
<input type="submit" name".." value="save">
</form>

and my.php will have:

<?php
$myname=$_POST['myname'];
..
//processing here....
..
?>

now how about if i remove the <form...tag. then instead of a submit
button ill replace it with a text linking to my.php. it loots
something like this:

<input type="Text" name="myname" id="myname" size="30"...<Br>
<a href="my.php?name='.$myname.'...>Save</a>

then my.php will look like this:
<?phpa
$myname=$_GET['myname'];
..
//processing here....
..
?>

my problem is how get the value of the textbox and assign it to
$myname variable.
is it possible with php or i need javascript for this matter? i hope i
was able to explain it clearly


May 16 '07 #3
shotokan99 wrote:
ah ok sorry for the inconvenience...let me try to explain it clearly.
usually if we have this:

<form name=".." method="post" action="my.php">
<input type="Text" name="myname" id="myname" size="30"...<Br>
<input type="submit" name".." value="save">
</form>

and my.php will have:

<?php
$myname=$_POST['myname'];
.
//processing here....
.
?>

now how about if i remove the <form...tag. then instead of a submit
button ill replace it with a text linking to my.php. it loots
something like this:

<input type="Text" name="myname" id="myname" size="30"...<Br>
<a href="my.php?name='.$myname.'...>Save</a>

then my.php will look like this:
<?phpa
$myname=$_GET['myname'];
.
//processing here....
.
?>

my problem is how get the value of the textbox and assign it to
$myname variable.
is it possible with php or i need javascript for this matter? i hope i
was able to explain it clearly

Unless the textbox is in a form, it will never be submitted to the
server, so PHP will never see it.

But why not use a form? That's why it's there.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 16 '07 #4
On May 15, 9:50 pm, shotokan99 <soft_devj...@yahoo.comwrote:
for instance i do have this element but i dont have a <form>:
<input type="Text" name="myname" id="myname" size="30"...>

then i have this link:
echo'<a href="mypage.php?name='.$myname.'...>Save</a>';

i want that $myname will the value of myname textbox. something like
this:
$myname= <the value of the textbox>

then on the side of mypage.php it will catch the values on same
manner:
$myname=$_GET['myname'];
.
.
.

i know this can be easily using <form>...</form>. but if i dont want
to use a for will it be possible? incase it is, how get the value of
the textbox and assign it to $myname variable?
If I understand your question, you wish to submit your form using a
textual link rather than a <input type="submit" ... />, button, or
image. HTML/PHP doesn't support this, but you can do it with a little
JavaScript. Still use a <form>, though:

<form method="post" action="my.php" name="hurray_js">
<input type="Text" name="myname" id="myname" size="30"...<Br>
<a href="javascript:document.hurray_js.submit();">Sub mit</a>
</form>
my.php:
</php
$myname = $_POST['myname'];
.....
?>

cheers,

Steve

May 16 '07 #5
Tom

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:zs******************************@comcast.com. ..
shotokan99 wrote:
ah ok sorry for the inconvenience...let me try to explain it clearly.
usually if we have this:

<form name=".." method="post" action="my.php">
<input type="Text" name="myname" id="myname" size="30"...<Br>
<input type="submit" name".." value="save">
</form>

and my.php will have:

<?php
$myname=$_POST['myname'];
.
//processing here....
.
?>

now how about if i remove the <form...tag. then instead of a submit
button ill replace it with a text linking to my.php. it loots
something like this:

<input type="Text" name="myname" id="myname" size="30"...<Br>
<a href="my.php?name='.$myname.'...>Save</a>

then my.php will look like this:
<?phpa
$myname=$_GET['myname'];
.
//processing here....
.
?>

my problem is how get the value of the textbox and assign it to
$myname variable.
is it possible with php or i need javascript for this matter? i hope i
was able to explain it clearly



Unless the textbox is in a form, it will never be submitted to the
server, so PHP will never see it.

But why not use a form? That's why it's there.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Along the lines of what you were saying, you can use $_GET variables by
formatting a web address link correctly

http://www.domain.com/index.php?key1='value1'+key2='value2'

but a textarea form field is too large to do that with. If you already have
a textarea that needs to be filled in, there's normally some submit button
and would probably be simpler using $_POST variables than trying to force
the textarea data in $_GET.

Tom
--
Newsguy.com
Unlimited Accounts - $19.95 / month
May 16 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ricki Susic | last post by:
Hi, Can anyone tell me if it is possible to call a function from a html form, where the function is included in the same file as the form. <html> <body> <form method="post" action="what...
4
by: Sims | last post by:
Hi, This will validate, (http://validator.w3.org/) <form method="POST" action="" name='xForm' style='background:inherit;'> <table style='background:inherit; width:100%;'> <tr width=80%> <td>...
2
by: Keiron Waites | last post by:
I have the following code: <input type="text" name="search" class="search_top"> <a href="" onclick="window.location='search.inc.php'+document..search. value; return false;"...
6
by: Don | last post by:
I'm trying to come up with a way within a client-side web page of uploading a couple files to a server-side PHP program without using a <form...>. I don't want to give up the page which happens...
4
by: Howard Jess | last post by:
In Opera 8.01 (Linux; Build 1204) and in Opera 7.54 (Windows XP; Build 3865), my form disappears from the HTML markup (below). To summarize: 1) In a <script> block in the <head> I create a form...
6
by: snacktime | last post by:
I've searched and searched and have not found a solution to suppress the margin on form or href tags so that there is no space before or after the tag. The only way I have found to do this is to...
4
by: rob c | last post by:
This is a minor thing and only appears in IE (so far), but I'd like to know to correct it (if possible). Whenever I use a form on a webpage, Explorer always leaves a blank line following the...
8
by: chris_fieldhouse | last post by:
Hi fairly new to php, but picking it up quite well. the question I have, is it possible for a php script which is used to validate values submitted in a form, to then post these values onto...
19
by: Coward 9 | last post by:
HI, I saw in an example hello.aspx, there is a <form tagbeing used like <form runat="server> I search all html tag references and could NOT find "runat" attributes for <formtag. which...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.