Jump to content

input type="scribble"


elementalgrace

Recommended Posts

I was looking for a solution to an unrelated problem yesterday when I came across type="scribble" for an input box, which is supposed to allow the user to scribble on a predefined area using a mouse. Thing is I can only find references to it for html 3 - has it been deprecated now, and if so has it been replaced by something similar?The info I found was on http://www.w3.org/MarkUp/html3/input.htmlCheersEG

Link to comment
Share on other sites

oh! i hope so! that's cool.can you download it the same way you do with txt?
I don't know - I'm trying to find out as it would be quite useful for a project I'm working on at the mo. I guess it's possible using java or something as well it would be really useful if anyone knows anything about this. :)
Link to comment
Share on other sites

I've never even heard of that. It depends on browsers supporting it, so maybe it never got any support. But it doesn't look like it's a part of HTML 4.01.I'm a little confused as to what it would do though, granted it would allow you to draw on top of an image, but since it's an input element, what would it submit to the server?

Link to comment
Share on other sites

I've never even heard of that. It depends on browsers supporting it, so maybe it never got any support. But it doesn't look like it's a part of HTML 4.01.I'm a little confused as to what it would do though, granted it would allow you to draw on top of an image, but since it's an input element, what would it submit to the server?
yah, that's what i meant to ask =)
Link to comment
Share on other sites

it was just a guess :)You hurt my feelings :)j/k :)I found this on google! I don't know how old it is . . . . .

SCRIBBLE - This type would allow the user to "scribble," with a mouse, pen, or arrow keys, on the image specified by the SRC attrib. If the browser is unable to display images, the SCRIBBLE type defaults to TEXT with an initial value of someval. How the information would be passed back is not yet defined.
I found this too. (it only works in Firefox, opera, and safari.
<html><head>	<title>Canvas Scribble</title>	<style type="text/css">	/* <![CDATA[ */	body {		-khtml-user-select:none;		-moz-user-select:none;	}	#canvas {		border:1px solid silver;	}	#button {		width:750px;		text-align:center;	}	/* ]]> */	</style>	<script type="text/javascript">	/* <![CDATA[ */	var canvas, context;	var x1, y1, x2, y2, dx, dy;	function windowLoaded() {		canvas  = document.getElementById("canvas");		debug   = document.getElementById("debug");		context = canvas.getContext("2d");		canvas.addEventListener("mousedown",mousePressed ,false);		canvas.addEventListener("mouseup"  ,mouseReleased,false);		context.lineCap		= "round";		context.lineJoin	   = "round";		context.lineWidth	   = 2;		context.shadowBlur	   = 3;		context.shadowColor   = "#ff0000";		context.shadowOffsetX = 2;		context.shadowOffsetY = 2;	}	function mousePressed(evt) {		canvas.addEventListener("mousemove",mouseDragged,false);		context.beginPath();		x1 = evt.pageX;		y1 = evt.pageY;	}	function mouseDragged(evt) {		x1 = x2;		y1 = y2;		x2 = evt.pageX;		y2 = evt.pageY;		context.beginPath(); // necessary for Opera 9.0beta. why???		context.moveTo(x1,y1);		context.lineTo(x2,y2);		context.stroke();	}	function mouseReleased(evt) {		canvas.removeEventListener("mousemove",mouseDragged,false);		context.closePath();	}	function clearCanvas() {		context.clearRect(0,0,						  canvas.getAttribute("width"),						  canvas.getAttribute("height"));	}	/* ]]> */	</script></head><body onload="windowLoaded();"><canvas width="750"		height="500"		id="canvas"></canvas><input type="button"	   id="button"	   onclick="clearCanvas();"	   value="Clear"/></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...