• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

form submittion - problem

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Play with this:
 
sakthi shan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry boss,
this is not working.
any more suggestions???
With Rgds,
SSV.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Erric,
I am using IE 5.5 browser. any more suggestions please...
With Rgds,
SSV.
 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic