|
How to disabled BACK & FORWARD buttons of the browsers using javascript?
|
|
|
|
|
That is an example of one of the most important don'ts of using JavaScript.
- It isn't possible using JavaScript, as well as the fact that all browsers will handle back and forward buttons/actions in different manners.
- Remember that the user always has control over what they're doing - no matter what your page is doing, browsers have been set up and created so that the user has the control over what they're doing and web pages cannot compromise this.
- (Even if possible) removing such a core feature of the web browser would simply irritate your users and make them go elsewhere.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
This is not Possible in Web Pages. But programatically you can do.
In java script:
BACK KEY:
1. check history.forward contains any data then call in history.back().
FORWARD KEY:
1. check history.back contains any data then call in history.forward().
|
|
|
|
|
Hi, I want the code for the functionality of a backspace button
plz post
|
|
|
|
|
onkeydown="HitBackSpace()"
function HitBackSpace()
{
if (event.keyCode==8)
{
alert("backspace");
}
}
cheers,
Abhijit
|
|
|
|
|
Hi Abhijit,
I am very thankful for responding however i wud like to implement the same functionality of BackSpace button to another button in C#.Net virtually. So plz help me in tht code.
|
|
|
|
|
srinivaskonijeti wrote: however i wud like to implement the same functionality of BackSpace button to another button in C#.Net virtually.
No Clear To Me !!! can you please confirm it details ?
cheers,
Abhijit
|
|
|
|
|
Can any one tell me what is the problem in the foll code. it is not workinh.
Response.Write("");
Response.Write("windows.location.href('Eventdetails.aspx?id='" + i +");
Response.Write("");
Regards'
|
|
|
|
|
use Page.ClientScript to register a javascript rather than use Response.Write
cheers,
Abhijit
|
|
|
|
|
raghvendrapanda wrote: Response.Write("");
Response.Write("windows.location.href('Eventdetails.aspx?id='" + i +");
Response.Write("");
What are you trying to do? Are you calling this function on some button click event? Then u need to wrap it in some function name.
Otherwise you just seem like redirecting to another page which can be done using Response.Redirect("EventDetails.aspx?id=" + i);
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
Hi,
I have a requirement where i need to format the phone number in 111-111-1111 format after it loses focus.
Can any one help me how to do this?
Santhapur
|
|
|
|
|
I was curious, so whipped up a test page:
<html>
<head>
<script type='text/javascript'>
function formatValue()
{
var v = document.getElementById('val').value;
var fv = document.getElementById('fval');
var re = /^(\d{3})[-]?(\d{3})[-]?(\d{4})$/
if(re.test(v) == true)
{
fv.innerHTML = RegExp.$1 + "-" + RegExp.$2 + "-" + RegExp.$3;
}
else
{
fv.innerHTML = "Bad!";
}
}
</script>
</head>
<body>
<input id='val' type='text' onblur='javascript:formatValue();'></input>
<div id="fval"></div>
</body>
</html>
The magic is in the regex. You can tweak it to accept other delimiters other than "-".
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
Hey Thanks Its working but.. But i need to display the formatted output again in the textbox itself. How can we do it ?
Please help me i am a begineer in the javascript programming. Or else give me a small clue i can try it out..
Santhapur
|
|
|
|
|
In my sample, replace:
fval.innerHTML = RegExp.$1 + "-" + RegExp.$2 + "-" + RegExp.$3;
with:
document.getElementById('val').value = RegExp.$1 + "-" + RegExp.$2 + "-" + RegExp.$3;
You can work out the best way of handling bad input however you want, maybe an alert or an error message.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
Hey,
Thanks I did it by own and anyways Thanka a lot for your help
Santhapur
|
|
|
|
|
Glad to help, and I learned something new today.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
There are several good articles on this site in regards to regular expressions and the Expresso tool for building regular expressions. I suggest you check them out during your free time
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I am trying to us a CSS class to set the back ground color of a text box but am having no luck. The .aspx page is a content page. Below is the .css and .aspx code:
.css
.HighLightBackColor
{
background-color:Yellow;
}
.aspx
<asp:TextBox ID="DADSInfoGeneratedTitle" runat="server" Text="Hello"
CssClass="HighLightBackColor"/>
|
|
|
|
|
We figured this out. The problem was that a default skin had been defined and was overriding the css.
|
|
|
|
|
keep it in a span and set the background color ..image what ever ..
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
hi,
m trying to deploy my first asp.net\sqlserver site, and i don't have any idea how can i do that, m trying to find a free hosting company to test it before i pay money for potting my site over internet.
so if any one have idea about that will be highly appreciated
thx.
|
|
|
|
|
you can test it on your local IIS, it should be the same, as long as you explain to the host seller exactly what you want.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi all. how to preserve state of the selected checkboxes inside a gridview in different pages. as on moving from one to another page, grid is rebinded.
|
|
|
|
|
Update the datasource that you use to rebind the grid.
I didn't get any requirements for the signature
|
|
|
|
|
do you mean i've to take an extra column in data source?
|
|
|
|