Helping ordinary people create extraordinary websites!

Go Back   Web Development Forum > Website Programming > Client-Side Scripting
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-05-2008, 05:10 AM
Junior Member
 
Join Date: Feb 2008
Posts: 2
Default syntax to capture the hyperlink text

hello everyone

i have a query , i want to capture the data which is given as hyperlink in the jsp page.
i have an employee page displayed, and the emp name as hyperlink and when i click on it , the edit page should open with the details of the employee
what is the syntax to capture the data of hyperlink

a immediate response would b really appreciable
thnku
shoba
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-05-2008, 07:22 AM
ryanhellyer's Avatar
Super Moderator
 
Join Date: Dec 2007
Posts: 685
Default

Hi and welcome to the forum
I'm not sure of the answer to your question, but hopefully our resident Javascript guru BigAl will be along shortly with a solution.

cheers,
Ryan

PS: You seem to have made a double post so I deleted the other one
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-05-2008, 08:48 AM
BigAlReturns's Avatar
Moderator Extraordinaire!
 
Join Date: Dec 2007
Location: The Wirral, England
Posts: 288
Send a message via MSN to BigAlReturns
Default

If I understand you correctly, I think the best way to go about this is using a get variable. Here is the way that I would structure it:
Code:
employeepage
<a href="editpage.php?empid=1">John Smith</a>
<a href="editpage.php?empid=2">Mike Jones</a>
etc. etc.
I've assumed here that you are using a database to store employee details, and that within your database each employee has an ID - this would be a typical way to structure it. You could easily then cycle through the employees with a WHILE loop, spitting out the ID and name in the appropriate places as the links above show. Then, your edit page gets the ID from the URL, and uses this to query the database for the appropriate employees records, something like this:
Code:
editpage.php
$empid=$_GET['empid'];
$query="SELECT empid,empname,etc,etc FROM employees WHERE empid='" . $empid . "'";
$result=mysql_query($query);
// etc etc retrieving results as you normally would
This is how I'd go about it, if your basic approach is radically different, or you can't see how you could integrate this approach into your existing code, then you will have to post your code up here, and we can help you out with how to solve the problem. Hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-06-2008, 12:44 AM
Junior Member
 
Join Date: Feb 2008
Posts: 2
Default

hi
this is the view part, i have displayed the client name as a hyperlink and when i click the link it goes to the controller where i have defined the edit page.(where i should b navigated to)

<a href="controller?EVENT_NAME=EDITCLIENT_LINK "><%=cname%></a>

the problem is, im unable to capture the data "cname" which i have set as a hyperlink ..............where when i click the option it should capture that data and go to the controller part

so wat should i write to capture the data , i mean the "cname"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-06-2008, 08:29 AM
BigAlReturns's Avatar
Moderator Extraordinaire!
 
Join Date: Dec 2007
Location: The Wirral, England
Posts: 288
Send a message via MSN to BigAlReturns
Default

OK, the basic principal of what I said still holds true - the only way you can pass the cname to the controller page is to pass it as a GET variable in the URL, something like this:
<a href="controller?EVENT_NAME=EDITCLIENT_LINK&cname= <%=cname%>"><%=cname%></a>

Then, the same way as you access the EVENT_NAME variable on controller, you can also access cname. By the way, what language are you using here? Not one I'm familiar with, but I've hopefully got the code write by extending what you posted.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-21-2008, 11:55 PM
Junior Member
 
Join Date: Feb 2008
Posts: 1
Default jsp submit

hi..
i want to pass the input parameter along with my action url..
how do i do?
my hyperlink is a filename and when i click on any filename that file name shud be passed..
but it shows me an error...
can anyone help?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-22-2008, 09:28 AM
BigAlReturns's Avatar
Moderator Extraordinaire!
 
Join Date: Dec 2007
Location: The Wirral, England
Posts: 288
Send a message via MSN to BigAlReturns
Default

Quote:
Originally Posted by shiva View Post
hi..
i want to pass the input parameter along with my action url..
how do i do?
my hyperlink is a filename and when i click on any filename that file name shud be passed..
but it shows me an error...
can anyone help?
I'm not really sure what you mean here - do you have a link to where we can see it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 03-11-2009, 06:01 AM
Junior Member
 
Join Date: Mar 2009
Posts: 20
Default overseas

What we're looking for are ideas, not Pulitzer Prize writers. Ideas are what fuel our magazine and our website. Now we want to expand that concept into eBooks for expats. You don't have to be a professional writer to submit a report that provides important information - - information that you yourself have learned by having been there and done it. That is exactly what our readers are seeking, facts about living overseas from people who've done it. Yes, you can make money from a good report or two... possibly a lot.
For more information visit:
COMPANY NAME
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 03-15-2009, 04:31 AM
Junior Member
 
Join Date: Feb 2009
Posts: 20
Default

hello and welcome to this forum




_____________
cheap air
Brazil Travel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -5. The time now is 09:27 PM.


Website Design by Ducani Media Group
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.