faqts : Computers : Programming : Languages : JavaScript : Event handling

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 24 people (42%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How can I update a NON-Javascript variable using the OnChange Event?

May 19th, 2001 19:44
Colin Fraser, Doru Davidson,


You may not be able to. But why do you want to try? 
If there is a variable in, say, PHP, and you want to update it, then a 
small PHP script should fix it using the onChange event. I know of no  
reason why the two scripts cannot run on the same page even on the same 
event. This does not mean it will work, but it may. You may be able to 
use JavaScript to trigger a PHP event handler, which may be a better 
way of doing it.  
As a general programming rule though, variables declared in one language 
will only be called and recognised in the same language. A variable is, 
in reality, a physical name for an address in  memory, so one language 
may try to overwrite the variable of another language as it does not 
recognize it as an active variable.
I doubt this is even worth the hassle of trying it.