Click here to Skip to main content
15,898,222 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionjava script for user can enter capital alplbets means capital A to Z only in text box. Pin
sanju056-May-09 23:58
sanju056-May-09 23:58 
AnswerRe: java script for user can enter capital alplbets means capital A to Z only in text box. Pin
Spunky Coder7-May-09 0:38
Spunky Coder7-May-09 0:38 
Questionproblem with apple safari Pin
nisha000006-May-09 21:15
nisha000006-May-09 21:15 
AnswerRe: problem with apple safari Pin
SeMartens6-May-09 22:52
SeMartens6-May-09 22:52 
Questionissues Pin
shenbagasiva6-May-09 21:05
shenbagasiva6-May-09 21:05 
AnswerRe: issues Pin
SeMartens7-May-09 0:07
SeMartens7-May-09 0:07 
AnswerRe: issues Pin
Vasudevan Deepak Kumar7-May-09 22:14
Vasudevan Deepak Kumar7-May-09 22:14 
QuestionMousedown event Pin
devvvy6-May-09 21:02
devvvy6-May-09 21:02 
hello

I need to determine from within an iframe mouse click "location", by that I mean:
1. nPosition = # characters from start of HTML document (err... preferably start means first character of hTML doc in iframe) to first character of the selected text.

This gives you x/y position, which is not what we need ...
<br />
Browser = navigator.appName<br />
	Net = Browser.indexOf("Netscape")<br />
	Micro = Browser.indexOf("Microsoft")<br />
<br />
	Netscape = false<br />
	IE = false<br />
<br />
	if(Net >= 0) {<br />
	Netscape = true<br />
	}<br />
<br />
	if(Micro >= 0) {<br />
	IE = true<br />
	}<br />
<br />
	function XYpos() {<br />
	if (IE == true) {<br />
	xPos = event.screenX<br />
	yPos = event.screenY<br />
	alert(xPos + " left " + yPos + " down")<br />
	}<br />
	else if (Netscape == true) {<br />
	alert("Script won't work: " + "\n" + "You're using Netscape")<br />
	}<br />


This retrieves the selected text, but (a) not the position {nPosition, nLength} of selected text and (b) not friendly with iframe.
<br />
function getSelText()<br />
	{<br />
		var txt = '';<br />
		 if (window.getSelection)<br />
		{<br />
			txt = window.getSelection();<br />
				 }<br />
		else if (document.getSelection)<br />
		{<br />
			txt = document.getSelection();<br />
				}<br />
		else if (document.selection)<br />
		{<br />
			txt = document.selection.createRange().text;<br />
				}<br />
		else return;<br />
		alert(txt);<br />
	}<br />


From W3C doc (URL below), these information is available.

"mousedown
The mousedown event occurs when the pointing device button is pressed over an element. This event is valid for most elements.

* Bubbles: Yes
* Cancelable: Yes
* Context Info: screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, button, detail"

Any suggestion? Thanks.

REF: http://www.w3.org/TR/DOM-Level-2-Events/events.html[^]

dev

QuestionFocus is going on address bar Pin
Jagz W6-May-09 20:44
professionalJagz W6-May-09 20:44 
AnswerRe: Focus is going on address bar Pin
mr_muskurahat6-May-09 21:04
mr_muskurahat6-May-09 21:04 
GeneralRe: Focus is going on address bar Pin
Jagz W7-May-09 0:23
professionalJagz W7-May-09 0:23 
QuestionASP.NET Exception ex.ToString to be available from browser? Pin
devvvy6-May-09 20:22
devvvy6-May-09 20:22 
AnswerRe: ASP.NET Exception ex.ToString to be available from browser? Pin
N a v a n e e t h6-May-09 20:42
N a v a n e e t h6-May-09 20:42 
GeneralRe: ASP.NET Exception ex.ToString to be available from browser? Pin
devvvy6-May-09 21:31
devvvy6-May-09 21:31 
Questionissues Pin
shenbagasiva6-May-09 19:56
shenbagasiva6-May-09 19:56 
AnswerRe: issues Pin
Spunky Coder6-May-09 20:05
Spunky Coder6-May-09 20:05 
AnswerRe: issues Pin
N a v a n e e t h6-May-09 20:35
N a v a n e e t h6-May-09 20:35 
AnswerRe: issues Pin
sumeshakshaya26-Jun-11 6:46
sumeshakshaya26-Jun-11 6:46 
QuestionRadGrid Pin
Rabiya266-May-09 19:01
Rabiya266-May-09 19:01 
AnswerRe: RadGrid Pin
mr_muskurahat6-May-09 21:06
mr_muskurahat6-May-09 21:06 
GeneralRe: RadGrid Pin
Rabiya266-May-09 21:31
Rabiya266-May-09 21:31 
QuestionHow to design Pin
Jaymm6-May-09 17:34
Jaymm6-May-09 17:34 
AnswerRe: How to design Pin
N a v a n e e t h6-May-09 18:02
N a v a n e e t h6-May-09 18:02 
GeneralRe: How to design Pin
Rabiya266-May-09 19:06
Rabiya266-May-09 19:06 
GeneralRe: How to design Pin
Greg Chelstowski6-May-09 21:27
Greg Chelstowski6-May-09 21:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.