473,397 Members | 2,056 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,397 software developers and data experts.

how to click and capture text

Hi,

I am displaying a table of records, one column is the student id. What html code do I need to allow user to select a student record by a click of a student id. In other words how do I make the id column clickable and at the same time capture the id number so I can process and display that student's details?

Thanks
Sep 21 '11 #1
6 1955
drhowarddrfine
7,435 Expert 4TB
It depends on how the records are displayed. You can just make the record an anchor with the id as part of the href.
Expand|Select|Wrap|Line Numbers
  1. <a href="example.com/mypage?record=12345">ID12345</a>
  2.  
  3. or
  4.  
  5. <a href="example.com/mypage/record/12345>ID12345</a>
Sep 21 '11 #2
Thanks drhowarddrfine,

It is now clickable but..

How do I click to refresh the same page to display student details?

What code do I use to get hold of the student id?

Here is my code

Expand|Select|Wrap|Line Numbers
  1. while ($row = mysql_fetch_array($result)) {
  2. echo "<tr><td>";
  3. echo "<a href='example.com/mypage?record=".$row['StudentID']."'>".$row['StudentID']."</a>";
  4. echo "</td><td>"."-".$row['FamilyName'].", ".$row['GivenNames']."</td></tr>";
  5. }
  6.  
  7.  
Sep 21 '11 #3
drhowarddrfine
7,435 Expert 4TB
Wrong board. Need to ask that question in that language's forum.
Sep 22 '11 #4
drhowarddrfine,

My previous sample code uses php to output html. However, my question still relates to html. What should the 'href=' statement look like to refresh the same page rather than jumping to another page? Also I need to grap the student id when clicked so that I can look up that record in the db. The 'record' bit in 'href=...record=xyz' is where I can find the id? How should I write that html code?

Can you help??


Sorry if I didn't make myself clear.
Sep 22 '11 #5
drhowarddrfine
7,435 Expert 4TB
HTML can't do any of that.
Sep 22 '11 #6
Ok, I will try my luck in the php forum.

Thanks drhowarddrfine
Sep 22 '11 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: jennyw | last post by:
I'm trying to parse a product catalog written in HTML. Some of the information I need are attributes of tags (like the product name, which is in an anchor). Some (like product description) are...
9
by: lkrubner | last post by:
I've got a function, you can see it below, that is being called onmouseup in the textarea on my main form. The idea is to find a selection if possible and store that text in a global variable. I...
1
by: rerb | last post by:
I would like to be able to capture the address bar URL as well as other text from text boxes in other applications. I can get the window handle but how to I get the text from a specific box? I am...
1
by: =?Utf-8?B?Sm9obiBHcmF2ZXM=?= | last post by:
Does any one know how to caputer text data sent to a printer to a file. I have seen a window service that captures text data sent to a printer on the server and save it to a file. I would like to...
2
by: swethak | last post by:
hi, My requirement is to capture the text information from website when we submit the url in the form.plz help that whats logic in that we used?
1
by: zeny | last post by:
Hey ppl, How can we capture text between html tags using regular expressions? For example, how to capture the words "hello", "world", "bla", "bla" and "bla" in the following input: <br><i>hello...
3
by: zeny | last post by:
Hey ppl, How can we capture text between html tags using regular expressions? For example, how to capture the words "hello", "world", "bla", "bla" and "bla" in the following input: <br><i>hello...
1
by: ssugumar7684 | last post by:
The problem is: I open 1 application i want that is correctly opened or not. I want to capture or get text value or anything value from window using VB Script can you give me code
3
by: khalidjan9 | last post by:
I have been given an assignment: Here is what i have? I have an app. (with out source code) that has some where about 20000 records in it. I want to extract all those records through my app. and...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.