I am trying to fix a bug in WYSWYG (NicEdit). When I copy and paste from a site it pulls the styles and elements that are in that copy ~ all I want is just the plain text.
So I am starting a script that can be used to override the paste in the textarea and strip the copy to plain text.
This is what I have so far (it's just a start):
So, when I paste in a texarea right now there is an alert that says "paste". What I want is to get the data in the paste and then strip it to plain text - then paste it in the textarea.
I have a form and I have a filed named password and its id= password and the other one is verify password. I want to make a function so that the user cant make (copy / paste ) or (ctrl+c , ctrl+x / ctrl+v) because many users on password field can try to copy the password and in the verify password filed they paste it again. I want to disable copy and paste in these 2 fields only.
i have two text boxes in Web application. When i enter data in first textbox second will enable automatically. i have written javascrit of onblur and onchanges and onkeyup event to enable the second textbox, it works fine but the problem is when i copied and pate it in first textbox throw the mouse event the second testbox is not enabled.
Query :1. How to enable & disable jquery Drag effect on click of a button?I am using this :-----> $("#image_to_map").draggable(); to applythe drag effect.
I need to call a function when user copy and paste the text value in the text box. I tried using "mousedown" event. But "mousedown" event handles left and right clicks when user clicks on the paste link on right click unable to handle the event. I am using jquery 1.5.
My paste catch trigger for autocomplete works fine for Ctrl-V. If using right click/paste, however, it will not trigger autocomplete. The paste event does fire with both keyboard and mouse, but for some reason it's not triggering the autocomplete, but again - Only with the mouse paste.
I have a div that I can drag on mousedown. In Firefox the code works as expected. In IE, however, it does not work anymore.
I noticed that if you put the mousemove event listener on the div that I'm dragging that it will get lost if you move the mouse wildly across the screen. So I decided to put the even on the window.
Now you can move the mouse as fast as you want in FireFox. In IE, however, it moves a little then stops - not reacting at all.
i have a really big table... and the <tr> tags have onclick/onmouseover events that highlight a row when you drag your mouse over it, and open a popup window when you click anywhere in the row...
if i however have some text in the row that has an href link attached to it, when i click on the link it will go to the href url AND open the popup window...
is there any way to stop the popup window from opening when i click a certain link within a row?
I am developing a website.Here i need to disable onmouseover event in onclick event. Actually i have one button with 3 functionalities like mouseover,mouseout,onclick.in every functionality image should be changed.but here my requirement is if we just put the cursor on the button (mouseover) and while come out from the button(mouseout) images should be changed.if we click on the button, image should be changed and some text should also displayed.here i am facing the problem is if we click on the button image was changed but it is not constatnly stayed.After onclick event if i comeout from the button again image was changed.At the time of displaying content i need to set the onclick image constantly.here i want to disable mouseover event.suppose if i click on again on the button after onclick event i want to display mouseout image(first image).
so in onclick event i want to disable mouseover event in javascript. i got the information like documnet.onmouseover=null; but it is not working.
As it's a charity, there are some variables such as whether or not to claim Gift Aid from the tax man. Therefore, various table inputs need to be optional. My initial thought was a longwinded dropdown of the various options. For example, if they want us to claim gift aid, the option to fill in name/address etc needs to become available. I just need to know how to disable the form section.
My question is I have this for form with couple options and a text box and what I want to do is when user selects the "none" textbox to be enabled and if user chooses "mysite" option textbox to be disabled so user can't put his/her input.
Here is my code: Code: <form id="form1" method="post" action=""> <label> <select name="none" id="noneid" > <option value="none">None</option> <option value="mysite">Mysite</option> </select> </label> <label>
Another <input type="text" name="another" id="anotherid" /> </label> </form> I think I need a javascript function to trigger by onchange event to disable or enable textbox depending on the user input. But I don't know how to write that function.
I found this handy little script on the net that means the user can only press backspace or numbers in form input.
<script type="text/javascript"> function numbersonly(e){ var unicode=e.charCode? e.charCode : e.keyCode if (unicode!=8){ //if the key isn't the backspace key (which we should allow) if (unicode<48||unicode>57) //if not a number return false //disable key press }} </script>
NOTE: Please make this intact if you want to use this script. Thanks. *************************/
function PasteSplitter(origMaxlen){ //you can also pass as many field references as needed in the argument var me = this; var arglen = arguments.length; this.flds = new Array(); this.maxlen = origMaxlen; this.filter = this.NUMERIC; //default filter for (var i=1; i<arglen; i++){ this.flds[i-1] = arguments[i]; } if (this.flds.length > 0){ var fld1 = this.flds[0]; fld1.onkeydown = function(event){ extendMaxLength(me.flds, me.maxlen, event); } fld1.onkeyup = function(event){ splitPaste(me.flds, me.maxlen, event) } if (typeof fld1.onbeforepaste != "undefined"){ fld1.onbeforepaste = function(event){ extendMaxLength(me.flds, me.maxlen, event); } } if (typeof fld1.onpaste != "undefined"){ fld1.onpaste = function(event){ //we need a little delay here before calling the function setTimeout(function(){ splitPaste(me.flds, me.maxlen, event); }, 10); } } }
function extendMaxLength(arrFlds, maxlen1, evt){ if (!evt) evt = event; if (evt.ctrlKey || evt.type=="beforepaste"){ var len = maxlen1; var arrlen = arrFlds.length; for (var i=1; i<arrlen; i++){ len += arrFlds[i].maxLength; } arrFlds[0].maxLength = len + arrlen - 1; //allow separators in beetween sets (e.g. - . /) } }
function splitPaste(arrFlds, maxlen1, evt){ var s = arrFlds[0].value; //apply filter switch (me.filter){ case me.NUMERIC: s = s.replace(/D/g, ""); break; case me.ALPHANUMERIC: s = s.replace(/W/g, ""); break; case me.ALPHA: s = s.replace(/[^a-zA-Z]/g, ""); break; default: //custom filter s = s.replace(me.filter, ""); } var len = s.length; if (len <= maxlen1){ arrFlds[0].value = s; if (arrFlds.length > 1 && len==maxlen1){ arrFlds[1].focus(); } return; } else { var len=0, start=0, arrlen=arrFlds.length, el; for (var i=0; i<arrlen; i++){ el = arrFlds[i]; len = (i>0) ? el.maxLength:maxlen1; el.value = s.substr(start, len); if (el.value=="" || el.value.length < len){ el.focus(); el.value = el.value; //this trick puts cursor at the end of value after focusing on the field first return; } start += len; } } arrFlds[0].maxLength = maxlen1; //change back to original maxlength } }
PasteSplitter.prototype.setFilter = function(filter){ //custom filter (regexp) may be specified this.filter = filter; } /***************end of script******************/
//SAMPLE USAGE function init(){ var f = document.forms[0];
//serial number var ser = new PasteSplitter(f.ser1.maxLength, f.ser1, f.ser2, f.ser3); //pass the original maxlength of the first field and all the references of as many fields as needed ser.setFilter(ser.ALPHANUMERIC); //set filter to alpha-numeric
//sss number var sss = new PasteSplitter(f.sss1.maxLength, f.sss1, f.sss2, f.sss3, f.sss4); //default filter (numeric) will be used } window.onload = init; //END OF SAMPLE USAGE
</script> </head> <body> <form> <h1>Paste Splitter v1.0</h1> <p>Copy any alpha, numeric or alphanumeric characters, even including separators such as slash (/), hyphen (-), dot (.) or anything, and then paste it in the first field. The characters will be split to all the fields automatically excluding the separator. Very useful for fields like serial number, Social Security number, telephone number and the like. The script works on the basis of the <code>maxlength</code> attribute of the field. It degrades well for JavaScript-disabled browsers, making the <code>maxlength</code> attribute untouched. It works well for IE for all paste commands (<code>CTRL+V</code>, <code>Edit->Paste</code>, <code>right-click->Paste</code>) and partially works for Firefox (<code>CTRL+V</code> only).</p> <fieldset> <legend>Information</legend> <label for="ser1">Serial No.</label> <input type="text" maxlength="5" size="5" id="ser1" name="ser1" /> - <input type="text" maxlength="4" size="4" id="ser2" name="ser2" /> - <input type="text" maxlength="6" size="6" id="ser3" name="ser3" /><br /> <label for="sss1">SSS No.</label> <input type="text" maxlength="2" size="2" id="sss1" name="sss1" /> - <input type="text" maxlength="7" size="7" id="sss2" name="sss2" /> - <input type="text" maxlength="2" size="2" id="sss3" name="sss3" /> - <input type="text" maxlength="1" size="1" id="sss4" name="sss4" /> </fieldset> </form> </body> </html>
If you have any comments, suggestion, bugs found, please feel free to post them here.
Is it possible to do this: when clicking a button, info is selected and copied to computers "cache" (don't know exact name) ready for pasting in other application like Word?
I have a web app (front end jquery, backend django) that allows usersto type commens into a text area. My users are asking for the abilityto cut and paste images into their comments. They want to use anwindows app called mwsnap to basically snap images from their desktop,then ctrl-v to copy the image into my django app. Does anyone knowwhat sort of client side support is needed to do this? I am fairlyadept at jquery/javascript, but haven't seen anything like this thoughit does seem like a very reasonable request since they are certainlyable to cut and paste into Outlook this way. However, when I try tocut and paste this way into yahoo mail or gmail it doesn't work, soperhaps this is a hard thing to do in a web app.
This may or may not be possible, but if anyone knows a way to do it,I'd love to hear from you.Basically, I simply (?) want to copy an image (e.g. from ALT-PrintScreen or 'Copy Image'), and paste/drop it into an img tag on a pageso it appears on the page. I can then resize, drag-drop, etc. asrequired.I've had a rummage around the net, but can't find anything. Maybe it's
How to make a form that automatic tab when we paste something into the box and sort it out automatically. Like cd-key box. When we copy n paste cd-key into the box it automatic inert everything into correct places.
I have built my menu as I needed on a seperate asp page and it works beautifilly. Then moved it to my actual web page and it ceases to function. and I am getting an error 'document.doublecombo.SECTOR is Null or object does not exist' I will include the non working piece in the following post, too long for here. Code:
I was just doing a simple stuff of executing system copy, delete etc. commands using execCommand method of js.
I have made two textareas, in one i am inputting some text and by hitting on the buttons i am executing copy, cut etc. commands.
Problems::::----
In this the paste button is not working. Like i am copying some text from one textarea, it is not pasting into other textarea.
Also I want to do select all for the textareas only. Like if cursor is on textarea1 and if I am hitting on selectAll button it should only select the textarea1 content. Currently it is selecting the whole page content. code...
In the following j and k are already initialized to zero and my match statements don't even find trkpt, much less the floating point values on that line.
Code: lines = document.gpxform.InputField.value.split(" "); for (i = 0; i < lines.length; i++) {