aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes form submittion - problem 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 "form submittion - problem" Watch "form submittion - problem" New topic
Author

form submittion - problem

sakthi shan
Greenhorn

Joined: Dec 12, 2003
Posts: 14
Dear All,
In my web page, I am having a hyper link. I am trying to restrict the user for clicking that link only one time, using the below code.
var submitFlag = false; // global variable.

function formsubmittion() {

if(submitFlag){
return;
}
submitFlag = true;
aThis.action="/genesys/screen?context=testing";
aThis.target="_top";
aThis.submit();
}

But as soon as the user clicks for the second time, the "submitted form" process is getting suspended. can anyone pls. clarify this.

With Rgds,
SSV.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I personally would do it this way

Not sure if that will work.
If you are still having problems then try to do this

Eric
sakthi shan
Greenhorn

Joined: Dec 12, 2003
Posts: 14
Hii,
Before posting this over here itself, I tried those options. But it was NOT working. Any other suggestions.
bye,
SSV.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Play with this:
sakthi shan
Greenhorn

Joined: Dec 12, 2003
Posts: 14
sorry boss,
this is not working.
any more suggestions???
With Rgds,
SSV.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
try not using the alert
instead of href="javascript:alert(...)"
just href="javascript:"
if that does not work, waht are you using exactly to submit the form
code, browser, etc
Eric
sakthi shan
Greenhorn

Joined: Dec 12, 2003
Posts: 14
Hii,
Following is the .js code I am using,
document.getElementById("Link").disabled = true;
aThis.action="/genesys/"+screen+"?context="+context;
aThis.target="_top";
aThis.submit();

with the xsl code as,
a id="Link" href="javascript nClickGoPolPrep(document.PolPrep,'PolicyPreparation','CreatePolicy')" class="NavigateLabel"

But even after clicking for the first time, the link is enabled. I mean, even after clicking for the first time, while moving the mouse over the same link, the mouse pointer is changing into hand symbol allowing the user to click for the second time. Any more suggestions please.
With Rgds,
SSV.
sakthi shan
Greenhorn

Joined: Dec 12, 2003
Posts: 14
Hi Erric,
I am using IE 5.5 browser. any more suggestions please...
With Rgds,
SSV.
himanshu patel
Ranch Hand

Joined: Feb 03, 2003
Posts: 205
Try this one.
<html>
<head>
<script>
var hrefDone = false;
function formsubmittion(){
if(!hrefDone){
hrefDone = true;
//Your code will go here
alert("Clicked first time");
}
else{
return;
}
}
</script>
</head>
<body>
<a href="javascript:formsubmittion()" >Test URL</a>
</body>
</html>


If you want to become a rich, do not work for others but make others to work for you.
sakthi shan
Greenhorn

Joined: Dec 12, 2003
Posts: 14
Dear Mr. Himanshu Patel,
even this is NOT working. clicked for the first time. while clicking for the second time, the thread which was submitted for the first time is getting stopped.

ANY MORE SUGGESTIONS PLS.

with rgds,
SSV.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
add this to the button
onclick="this.style.display='none'"
or
onclick="this.style.visible='hidden'"
They will not be able to see the button to click it again.
himanshu patel
Ranch Hand

Joined: Feb 03, 2003
Posts: 205
How about this one?
<html>
<head>
<style>
.mylink{
FONT-SIZE: 11px;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
COLOR: #006666;
}
</style>
<script>
function formLink(){
document.getElementById('MenuF').style.visibility="visible";
document.getElementById('MenuF1').style.visibility="hidden";
// Put your submittion code here
}
</script>
</head>
<body>
<div style="position: absolute; visibility: visible;" id="MenuF1">
<a class=mylink href="javascript:formLink()" style="">Test URL</a></div>
<div style="position: absolute; visibility: hidden;" id="MenuF">
<font class=mylink >Test URL </font>
</div>
</body>
</html>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: form submittion - problem
 
Similar Threads
Saving the form before navigating to some other page
Changing Domain object's constraints on the fly.
Design help
JSP throwing null pointer exception the first time I run it
Suggention on JTable