web vbscript question... newbie 
Author Message
 web vbscript question... newbie

I have a bunch of text-input boxes in an HTML form with a sub 'my_sub()'
called from all of them on the onclick event.  How can I determine the
object that triggered the event (ie. the text-input box) from within
my_sub()?  or is that even possible?

Thanks in advance,

Neil Pengelly



Sun, 14 Jul 2002 03:00:00 GMT  
 web vbscript question... newbie

window.event.srcElement.id or name

--
Michael Harris


  I have a bunch of text-input boxes in an HTML form with a sub 'my_sub()'
  called from all of them on the onclick event.  How can I determine the
  object that triggered the event (ie. the text-input box) from within
  my_sub()?  or is that even possible?

  Thanks in advance,

  Neil Pengelly



Sun, 14 Jul 2002 03:00:00 GMT  
 web vbscript question... newbie
Define your text-input boxes like this example:

<input id=fx1 class=nlayout1 onClick="JSCRIPT:my_sub(this);">

Then my_sub starts with

Sub my_sub(my_element)
'...
Id = my_element.id
Value = my_element.value
'...
'and so on

Why, you wonder do I bring in that JSCRIPT fragment?
You could use
onClick="VBScript:my_sub(me)"
But the JSCRIPT version has one important flexibility advantage, you
can create such fields on the fly including writing them into divs with
RSPROXY
and other such tricks which unfortunately my beloved VBSCRIPT can't match.
Such on-the-fly JSCRIPT fragments can call VBSCRIPT subs.


Quote:
> I have a bunch of text-input boxes in an HTML form with a sub 'my_sub()'
> called from all of them on the onclick event.  How can I determine the
> object that triggered the event (ie. the text-input box) from within
> my_sub()?  or is that even possible?

> Thanks in advance,

> Neil Pengelly




Mon, 15 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Newbie - Web Question - turning VB project into Web material

2. newbie question: generating Excel spreadsheet from the web

3. Includes and Web Naviagation -Newbie question-

4. VbScript WEB-Access dB Entry Form (newbie ?)

5. newbie vb.net web forms questions

6. Add Web Reference - Newbie question

7. Newbie VB/Web question

8. web browser - newbie question

9. Newbie VB/Web question

10. Web newbie question...

11. Web newbie question

12. Newbie question about Web Displaying of Crystal Reports

 

 
Powered by phpBB® Forum Software