MattEvans 473 Veteran Poster Team Colleague Featured Poster

Thank you very much!!! You gave me a solution that envolves javascript that is interesting...
ho!, and sorry about my english...

mine is a javascript solution aswell, but it's all squashed into one parameter line. you could expand it to:

<script type="text/javascript">
function checkclear(what){
if(!what._haschanged){
  what.value=''
};
what._haschanged=true;
}
</code>

<input type="text" value="Click here to clear text" onfocus="checkclear(this)"/>

and then use "checkclear(this)" as the onfocus property for all text inputs that you want to have the same behaviour.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

onClick will work on most elements, onfocus is more appropriate for a text input, as tabbing to a field also counts as focus...

try:

<input type="text" value="Click here to clear text" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;"/>

it will only clear the text once.. i assume you want to actually put something in the text afterwards,,

MattEvans 473 Veteran Poster Team Colleague Featured Poster

JavaScript is of course standardized. What confuses many is that it's a scripting language, so interacts with the underlying DOM, and that each doctype has its own DOM. Morever, JavaScript is used with other, non-HTML DOMs as well, such as Acrobat. However, the language itself is standardized.

ah, you got me there, but the ramifactions are a consideration; however small.

it's not just doctype aswell, different browsers need to be considered regardless of doctype.. non-browser-dependant js code is usually quite messy looking at the very least.

for me it's a very small consideration; because i minimize the importance of js code :P if i scripted a site entirely in js, it would be a bigger consideration, as some people are absolutely nuerotic about their security online, and disabling js isn't difficult.

admittadly though, it isn't as likely as someone not having flash installed/enabled, or not having an up-to-date version of java.

there has never been a situation where we had to code around a "non-JavaScript" user. Not once.

not to deliberately perpetuate the, already well-perpetuated js-fear.. but you wouldn't neccessarily know the amount of non-js user's who couldn't use your company/ies, or client(s) sites if elements of those sites were totally js dependant.

for the most part, users go elsewhere when things don't work as expected, regardless of whether the problem's on a page, or with a security setting.. and almost anything that's functionally js-dependant doesn't need to be..

to me, that seems to …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Not really sure what you want...
But wouldn't
HTML Code:
<a href="#" target="_blank"><input type="button" /></a>

work for you?
(You may have to define height and width for IE though).

nope, not with my doctype anyway (transitional)

I don't think theres anything wrong with nesting forms?

yerp, there is. it seems the action is taken from the first form.

i didn't use any absolute positioning in the end, i let the button in the form float, and the second button (in a floating form) fits right in there [on either side, depending on the float direction]. it only works if both forms have margin-top:0px and margin-bottom:0px.

This entire discussion is very amusing. In short, you have to use JavaScript for most of the questions in this thread. There is no reason not to do so, either. If you want a real-world solution, don't impose silly restrictions. This is like saying "I need directions from my business to yours, but I'll only take left turns".

well. not everyone has js available or enabled; and it's not very well standardised. i prefer to keep all neccessary functions outside of javascript, and use it for effects only.. i write pages with js dependant things hidden by default... then, if js can work, it shows all of those things, otherwise; the user doesn't even know what (or even what it is) that they're missing.

still, a browser that doesn't support JS probably doesn't support CSS either.. :P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

onmouseup="somepage.htm"

is that not JS though?

EDIT: infact, it's not just JS, it's erroneous JS, should be

onmouseup="window.location='somepage.htm'"
MattEvans 473 Veteran Poster Team Colleague Featured Poster

you can hyperlink the entire contents of a div... put an enormous image inside it, set the overflow to hidden, and hyperlink the image :P

i have a q, i was gonna start a thread but this is close enough to my question:

can you hyperlink a form submit field? O_o it seems trivial but it isn't proving easy... I want a form with a normal submit button (so I can't use the form action) and another button that just opens a new page... i don't want to use JS, and I don't mind how much markup i need on the page.. (actually, i'm using "button" rather than input/submit) so i guess, i can stick i giant hyperlinked image in a overflow controlled div in a typeless button.

messy =)

any better solutions..? o_O

EDIT: bah... that doesn't work though! who decided you can't have hyperlinked anchors in buttons? :| as i'm overriding the button graphical style anyway, i guess i can just emulate it with a div... i have to use JS to toggle the edges and padding to give a "clicked" appearance... but at least i don't have JS depandant functionality...

another solution.. is to absolutely place another form and button next to the submit button and use the form action... methinks that's messier.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

whoever actually "made" java, certainly made it as a tribute to (their addiction to) the strong stuff, i don't think i could do a day's programming without replacing my bodily fluids with caffiene juice.

if i released a programming language, i'd probably call it nicotine.

Matt

MattEvans 473 Veteran Poster Team Colleague Featured Poster

i honestly have no idea what a Java sheet is; but if I had to hazard a guess, it's one of the original sheets of paper that a Mr. John Java-Jones used to plan, design, and eventually implement Java upon, back in the year-of-our-lord 1308.

very rare if you can get your hands on one, very rare indeed.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

there's at least one mistake in the diagram; the line labeled "rho" is actually not rho; you need to calculate the length of that line to work out phi, so rename the line rho on the diagram to the line B.

rho now is equal to the "radius" and is constant for all values that fall on the sphere's surface.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I've attached a new image showing how to get rho,phi and theta values on a sphere; bear in mind these equations have only been tested mentally, so look carefully at the proofings. You may find that some of the axes are expressed upside down, that's a common mistake I make.

You'll notice that there's no longer a Z (distance from viewplatform (eye) to the surface of the circle) in terms of the Y and Z (that is; origin-to-origin displacement Z). It's no longer calculatable by those terms as it was before because the theta value (well, third dimension) affects that distance.

Once you have these; converting them to UV is dependant on your system of mapping UV co-ordinates to rho, phi and theta values. I'm assuming that you derive the UV co-ordinates from rho, phi and theta values, and in that case it'll be easy. I can't tell you how; because UV isn't finite/has no referenceable standard that I know of.

On your sphere, the vector from the eye point to the matrix is the vector from the origin of the camera/viewplatform to a vertex on a shere as it would be if it were a point in global space (so after rotation, scale etc), bear in mind the vertexes location is not the UV co-ordinate.

The modelview matrix is a mixture of the transform matrix * of a model and the transform matrix of the viewplatform/camera/eye. If the object is never moved but the eye …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

it actually only converts a Y to a Z (2D), the value of Z also has to be in terms of the X to be a sphere; to convert them to a spherical system, rho will equal Z, phi will equal Y, and theta will be in terms of Z and X, the sphere co-ordinates and/or mapping to UV depend on the rotation, translation and scale of the sphere at any moment in time.

EDIT: no, rho will equal (distance from sphere to viewing platform) - Z, and phi will equal the distance from the Y origin of the viewing platform to the Y co-ordinate (as clicked on the Canvas)

do you have the java3d demos? look for ..\jdkx.x\j3d\demo\index.html and check out, PickTest and IntersectTest. These methods work by flagging collisions as the graphics are rendering as opposed to calculation positions from current transform3d objects.

Intersect test is quite good, shows picking of points rather than objects.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

If you were only using a circle, not a sphere, it's simple trigonometry; sphere is abit more difficult though, do you have to take rotation (of the sphere) into account?

For a circle though; see attached image, and you must know:

- The distance (D) from the viewing platform to the center of the object
- The distance (Y) from the line Y=0 (relative the sphere AND viewing platform) to the point where the click is received from.
- The radius (R) of the object.

This won’t work directly with spheres, it assumes a cylindrical object lateral to the viewing platform, with a zoom factor of 1, and no transformations.

The point you’ll get is X,Y,Z where (X,Y) are the clicked co-ordinate, and Z is the result of:

t = asin(Y/R)
B = cos(t) x R
Z = D – B

If the X and Y values are within a distance (the object’s size as centred around the line X = 0, Y = 0) from the point X = 0, Y = 0; then the point is on the surface of the object, at the point X,Y,Z relative to the viewing platform.

To map that to a texture co-ordinate is different, it depends on your texturing system/method of creating the object; you can find the point relative to the object as opposed to relative to the viewing platform by subtracting the value of Z from the value of …