473,395 Members | 1,652 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,395 software developers and data experts.

Pass value from a ahref to a textbox


http://www.zshare.net/image/problem-png.html

I want to make the text on the left 2 columns clickable. When it's
clicked, the form will be POSTed and the code in the leftmost column
will be submitted as $_REQUEST['item_selected'].

How could I do that?

--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10) Linux 2.6.21.1
^ ^ 18:59:01 up 17 days 3:52 1 user load average: 0.03 0.03 0.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk
May 15 '07 #1
2 1391
On May 15, 11:59 am, Man-wai Chang <toylet.toy...@gmail.comwrote:
http://www.zshare.net/image/problem-png.html

I want to make the text on the left 2 columns clickable. When it's
clicked, the form will be POSTed and the code in the leftmost column
will be submitted as $_REQUEST['item_selected'].

How could I do that?

--
.~. Might, Courage, Vision, SINCERITY.http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10) Linux 2.6.21.1
^ ^ 18:59:01 up 17 days 3:52 1 user load average: 0.03 0.03 0.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk
<script>
function submitnow(itemvalue)
{
document.getElementById('item_selected').value = itemvalue;
document.getElementById('myform').submit();
//will work if the form id is "myform"
}
</script>

<form id="myform" ....>
have a hidden input called
<input type="hidden" name="item_selected" />

make the text links and use
onclick="submitnow('B0001')"

you can access the posted value at $_POST['item_selected'] or
$_REQUEST['item_selected']

May 15 '07 #2
<script>
function submitnow(itemvalue)
{
document.getElementById('item_selected').value = itemvalue;
document.getElementById('myform').submit();
//will work if the form id is "myform"
}
</script>
Thank you very much

--
iTech Consulting Services Limited
Expert in ePOS (Point-Of-Sales) solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288
May 16 '07 #3

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

Similar topics

1
by: Terry | last post by:
hi, could any1 help me with this? There're one button and one textbox on Page A. click the button: <Code Behind > Dim ClientScript As String = ""
1
by: Chandru | last post by:
hi Thanks, some of reply for my query. the actual problem is, I have two forms Form-A and Form-B. In Form-A i have two controls TextBox and Button, and in Form-B i have the same one textBox and...
6
by: Adrian | last post by:
hi, if i have a textbox (not in a form) on an html page and a link to another page how can I use the textbox value when the link is clicked? i.e. <input type="text" name="T1" size="20"> <a...
0
by: colleen1980 | last post by:
Hi: There are two textboxs in my main form. One is bound and another is unbound. There is no entry in the unbound textbox as values come into automatically after entering some information in the...
10
by: tshad | last post by:
I want to access multiple arguments based on name passed. For example I have the following asp:textboxes: BillingAddress1 BillingAddress2 BillingCity ShippingAddress1 ShippingAddress2...
1
by: colleen1980 | last post by:
Hi: Can any one please tell me that how to i pass the two textbox values in the new page. If i use the form action in the popup window page then the new page is open in the same popup window as i...
2
by: darren.murray2 | last post by:
Hello all, I'm fairly new at this so I may be doing this the wrong way but I've got a FormView within a multiview that when it is updated in edit mode, will call on the update method associated...
2
by: | last post by:
I have a gridview with a textbox in an ItemTemplate, as below. The OnTextChanged event fires okay but how do I pass a parameter to it, I get an error when I try "OnTextChanged(""SomeData"")". I...
4
by: ismailc | last post by:
Hi, I need help please. I need to create a textbox with a report url in an iframe below. Onclick of button create IFrame and pass textbox value into parameter of iframe src. I'm not to sure...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.