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

form submittion - problem

 
sakthi shan
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Play with this:
 
sakthi shan
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry boss,
this is not working.
any more suggestions???
With Rgds,
SSV.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Erric,
I am using IE 5.5 browser. any more suggestions please...
With Rgds,
SSV.
 
himanshu patel
Ranch Hand
Posts: 205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
sakthi shan
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic