aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Disabling a href=... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disabling a href=..." Watch "Disabling a href=..." New topic
Author

Disabling a href=...

Jan Ivanov
Greenhorn

Joined: Jul 20, 2006
Posts: 19
I have two HTML <a> tags in my servlet. I need to disable them for a time when servlet do some jdbc operations. How can I do it ?
Rusty Smythe
Ranch Hand

Joined: Aug 09, 2006
Posts: 93

I'm confused. Are you saying that you want to prevent the user from leaving the page while you get data from a database, or something else?

Can you post the code that shows the two "a" tags, as well as the start of the code that does the "jdbc operations"?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

If you don't want those links, then don't write them to the page when they are not relevant.
Jan Ivanov
Greenhorn

Joined: Jul 20, 2006
Posts: 19
yes exactly !

That servlet import something to DB from file. It can last from seconds to couple of minutes. Servlet also shows percentage process progress. I want to disable two hrefs until it's finished.

How can I do it ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61653
    
  67

Not a servlet issue. Moved to the HTML forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rusty Smythe
Ranch Hand

Joined: Aug 09, 2006
Posts: 93

Answering this question is impossible (or very hard) without code.

I can think of several ways to do this, using a servlet, javascript, or whatever, but until I can see your approach, I can't help you.
Jan Ivanov
Greenhorn

Joined: Jul 20, 2006
Posts: 19
Code is huge

I must simplify it

doPost() method

Jan Ivanov
Greenhorn

Joined: Jul 20, 2006
Posts: 19

[ August 15, 2006: Message edited by: Jan Ivanov ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
If the code is running on the server, it can not change what is happening on the client until it is processed. So you would have to remove the links before you submit the page to the server for processing.

Eric
Liu Zhixiang
Ranch Hand

Joined: Aug 12, 2006
Posts: 32


This my idea.Test please!
[ August 15, 2006: Message edited by: Liu Zhixiang ]

I Think Therefore I Am
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61653
    
  67

Why on earth would you generate HTML markup in Java strings?
Jan Ivanov
Greenhorn

Joined: Jul 20, 2006
Posts: 19
Liu it's not working Any idea ?
Liu Zhixiang
Ranch Hand

Joined: Aug 12, 2006
Posts: 32
are yue sure?
dont forget the "id" in line 3
oh,maybe it is right that is said by Eric.




if it's not working all the same,i think i only say sorry to you.
Maybe javascript cant help you.
[ August 16, 2006: Message edited by: Liu Zhixiang ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disabling a href=...