File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to change the value of Hyperlink

 
pankaj semwal
Ranch Hand
Posts: 303
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am getting some dynamic record in my jsp page.and each records there is corresponding hyperlink .i.e issue.

I have a drop down box which consists of two values pending and issue.
On the selection of pending my records are showing with corresponding hyperlink .
But on selection of issue value i want to change the value of hyperlink i.e it should be view.
Please help me how to do this.
Thanks

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use a Meaningful Subject: http://faq.javaranch.com/java/UseAMeaningfulSubjectLine

You can change your subject by clicking the edit button in your post.

Eric
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you show and hide the link by setting the display equal to none or inline.

If you want to chaneg the link obj.href="foo" and obj.innerHTML = "bar"

Eric
 
pankaj semwal
Ranch Hand
Posts: 303
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
But my problem is that my hyperlinks are generated dynamically.
Thanks
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without seeing code, we know no clue how anything works. So if you want better answers, post some code.

Please edit your original post and change the subject.

Eric
 
pankaj semwal
Ranch Hand
Posts: 303
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i want to change the value of hyerplink value whose id is issueAppointment when the index of drop down box is 2.
Please help me.


This is my jsp page code;




and Below is my js code

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are changing the page location here:



If you want to change the link, you need to set the links href, not the window location.

Eric
 
pankaj semwal
Ranch Hand
Posts: 303
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
if i select the dropdown box value pending then the
window location should be
window.location.href='appointementlist!showappoinList.action'

and otherwise
window.location.href='appointementlist.action'

after getting new location i want to change the value and href of hyperlink.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you change the page location, the page no longer exists.

It is like erasing your whiteboard, you need to start over again.

Eric
 
pankaj semwal
Ranch Hand
Posts: 303
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then can you tell me how can i do this.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not know what you are trying to do exactly. You are changing the page and you want the new page to have a different link? Why is the server not setting that up than?

Eric
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic