[Phpwm] [OT]event trigger

Phil Beynon phil at infolinkelectronics.co.uk
Wed Mar 14 14:37:41 GMT 2007


> > Does anyone know how to get a javascript on-event trigger to fire from a
> > right click menu paste into a form input field?
> > I'd have thought that a set focus on window load might have done it, but
> > it
> > didnt!
> > It works fine on typing into the field and ctrl V.
> >
> > I Googled it for a bit but didn't see anything conclusive.
> >
> >
> > Regards,
> >
> > Phil Beynon
>
> I'm not sure I know exactly what you're asking, although this might help.
>
> I don't believe you can specify an event as details as to which item they
> press in after using the right mouse button.
> Perhaps this solves some of your problem though:
> http://www.w3schools.com/js/tryit.asp?filename=try_dom_event_button is an
> example to work out which mouse button was pressed. Then whatever you'd do
> after that would be much the same as before.
>
> >From Paul.

I am so stupid sometimes......

I have two pretty much identical forms on the page concerned, one for adding
a record, the other for editing - I was adding on-events to one and testing
the effect on the other form!

This works now;

<input name="group_name" class="MedInput" type="text" value="<?php echo
$myrow["group_name"]; ?>" size="50" maxlength="50"
onfocus="textCounter(this,'progressbar2',50);FldVal(document.formthree);"
onKeyDown="textCounter(this,'progressbar2',50)"
onKeyUp="textCounter(this,'progressbar2',50);FldVal(document.formthree);"
onMouseDown="textCounter(this,'progressbar2',50);FldVal(document.formthree);
"
onMouseOver="textCounter(this,'progressbar2',50);FldVal(document.formthree);
"
onMouseOut="textCounter(this,'progressbar2',50);FldVal(document.formthree);"
>
<div id="progressbar2" class="progress"></div>
<script>textCounter(document.getElementById("group_name"),"progressbar2",50)
</script>

Which if anyone wants the source is a routine that does a text counter
bargraph / submit disable until required field(s) populated / disable after
submit.

Phil




More information about the Phpwm mailing list