Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get user IP on intranet
Message
 
 
To
09/07/2014 13:18:40
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01603311
Message ID:
01603432
Views:
40
>>Thank you (and Viv). For me it is important to log the IP of a user who submits within several seconds. Basically I am troubleshooting the following issue. Users submits duplicate orders by Submitting and then clicking on Back and Submitting again. They claim that they don't do it. And the only way I can prove to them (and to myself) is by logging every Submit with the IP and order number. So two submits within seconds with the consecutive order numbers and the same "IP" will show the trend.
>
>Try to disable the button before submitting the request. That should resolve most of those duplicate-type hits.
>
>Here is an example:
>
>
><input type="submit" name="LabelSubmit" value="Cancel" onclick="ButtonOperation(this,'ViewPageGenericConfirmationMessage.aspx');
> return false;" id="LabelSubmit" style="width:150px;" />
>
>function ButtonOperation(toButton,tcUrl,tcMessage)
>{
>   toButton.disabled=true
>   lcMessage=''
>   lcUrl=''
>   if (tcUrl==null)
>   {
>      lcUrl=''
>   }
>   else
>   {
>      lcUrl=tcUrl
>   }
>   if (tcMessage==null)
>   {
>      lcMessage=''
>   }
>   else
>   {
>      lcMessage=tcMessage
>      lcMessage=lcMessage.replace('\\','\\\\')
>      lcMessage=lcMessage.replace("'","\\'")
>      lcMessage=lcMessage.replace('"','\\"')
>   }
>   if (lcMessage.length>0)
>   {
>      if (confirm(lcMessage))
>      {
>         if (lcUrl.length>0)
>         {
>            location.href=lcUrl
>         }
>         else
>         {
>            loForm=document.getElementById("Form1")
>            loForm.submit()
>         }
>      }
>      else
>      {
>         toButton.disabled=false
>      }
>   }
>   else
>   {
>      if (lcUrl.length>0)
>      {
>         location.href=lcUrl
>      }
>      else
>      {
>         loForm=document.getElementById("Form1")
>         loForm.submit()
>      }
>   }
>}
>
>
>It does not have to be that complicated. It is just that I want to support a confirmation message sometimes so I built a generic javascript function for that.

First, thank you for the sample code. As I mentioned to Viv, when user submits an order, the Acknowledgment is shown. And it clearly says that the order has been received. But users, for whatever reason, can click on Back button (in the browser) and return right back to the Order page. The order page "does not know" that this is a duplicate order and user can Submit it again.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform