How to detect ctrl+v ,Ctrl+c using Javascript?
i need to restrict pasting in my textareas,end user should not copy and paste the content,
user should only type text in text area.
how to achive this.
Thanks in advance.
...
Hi guys, I'm bulding a brand new site for the disco I work for.
Please take a look on the guests page: http://www.jubileegroup.it/jubilee/guests.php
I've been able to get the exact effect I wanted when the pointer moves on a picture, but I think my code is really...bad... I'm sure there must be something cleaner.
I'm using this in jQu...
I am using jQuery to hide a div on my page:
$(document).ready(function(){
$('#message').hide();
When a certain part of the page scrolls into view the div shows using
$(window).scroll(function() {
var top = 0;
top = $(window).scrollTop();
if((top >= 1000) && (top < 2000)){
$('...
I have the following code (asp.net-mvc, jquery) (i have simplified the example to show the issue) where i want to click on an image and have it replaced with another image.
This works fine but the first time i click it, the original image disappears (for a split second) before the other image shows up. After that it works seamlessly.
...
I have some jQuery code something like this:
$(document).ready(function() {
$("img.off").click(function() {
alert('on');
$(this).attr('class', 'on');
});
$("img.on").click(function() {
alert('off');
$(this).attr('class', 'off');
});
});
The selector works fine for images that have the c...
I am using $.validator.addMethod
How can I print the validation message in a control. I have a div id="err" where I want to print the message
Here is what my method looks like
$.validator.addMethod('something', function(value, element) {
return false;
}, 'I want to display this message in a Div with ID=error')
...
Hi everyone,
I want to write javascript that will kill sestion on the web page if user did not make any action for some time taken from configuration.
How can I know that user did not make any actions by using jQuery.
Thanks a lot.
...
Hi, I don't understand why I'm not getting the message as "username already exits" if type the username which is already in database.
If the username in a server, then it is returning the value as "1" otherwise empty, and despite of successfully getting the value from the server based on username is present or not, and assigning the...
I need to fire the change event when other javascript function changes the checked status.
Simplified code below. I can not call MyFunc() from MyOtherFunc().
jQuery:
$(document).ready(function(){
$('input:radio[name=rdName]').change(function(){
MyFunc();
});
});
function MyFunc(){
//do stuff
}
function MyOtherFunc(){
$('inp...
Ok this is frustrating... The code below works "correctly" as far as sending the email address to the SaveEmail URL and it gets saved correctly each time I change the drop down. However it only outputs the "Successful" message once, no matter how many times I change the value in the drop down. The "data" that is returned is "Successful"...
What is the practice to pass arguments from HTML to jQuery events function.
For example getting id of row from db:
<tr class="jq_killMe" id="thisItemId-id">
...
</tr>
and jQuery:
$(".jq_killMe").click(function () {
var tmp = $(this).attr('id).split("-");
var id = tmp[0]
// ...
}
What's the best practise, if I want ...
I am using this statement alert(el.parent().next());
But I am getting [object] [object] as an alert. How do I display the ID of the element?
...
Hi All,
I have two pages name one.php and two.php in one.php i have a combo box which has a option values like
option value='0'
option value='1'
option value='2'
option value ='3'
Now when on change event of combo box fires i am opening one new window named 'two' as follows
$('#sel').live('change',function(){
var tindex=$(t...
I want to check the checkboxes whenever some conditions are met.
Some content is ajax-loaded by asp.net updatepanel.
How can I update those checkboxes?
Any event like "onload" I can use to bind using jquery live()?
...
When I say, msg.appendTo(ele.parent().next()), the msg successfully gets appended to a <p> with class=foo
How can I specify it explicitly in the statement?
I tried msg.appendTo(ele.parent().next().find('.foo'));
but it doesn't work
...
I'm basically trying to do exactly what the subject suggests, but I'm getting "undefined" in my alert, and I'm not entirely sure why. I am fairly new to jquery, so, I probably have the syntax wrong, but not sure where to go from here. I'll post both of my attempts, which both yield "undefined" in the alert...
//In my first attempt, I...
How could I change the code of jQuery Context Menu Plugin such that the context menu will appear also for items that are added in the future ?
For example, I would like the context menu to appear for all cells in a table that have my_class class. I set up the context menu like this:
$(".my_class").contextMenu(...)
Then, later, the us...
I'm using a slider as user input for a screen. Basically it's a bulk update screen where there is a table with multiple rows, thus multiple sliders. I created it so that the hidden value is what gets posted in the form.
<td>
<input class="percentageProvidedHidden" type="hidden" name='<%= "Values[" + i + "].Percentage" %>' value='<%=...
I am making an ajax request using JQuery that looks like this:
var data = createXMLdata();
$.ajax({
url: 'http://localhost:8080/foo/bar',
type: "PUT",
data: data,
processData: false,
contentType: "application/text",
error: function(xhr, status, error) {
alert("Error: " + status);
},
success: funct...
Hi all;
html code:
<asp:Button runat="server" ID="btnTest" Text="Test" OnClick="btnTest_Click" />
Jquery Code:
$('[id$=btnTest]').click(function(){
$('[id$=btnTest]').attr('disabled', 'true');
});
CodeBehind:
protected void btnTest_Click(object sender, EventArgs e)
{
//here not come.
}
Code Behind btnTest event not work ?
...