Hi all, I have some variables in python (getting from DB), now what is the best way to access these variables in javascript? For example, i want to populate person name , city & street which are separate textboxes. If i change the person name, the city & street should automatically change by using javascript onChange event. Are there any examples onthe web in this approach? Thanks Harish ________________________________________________________________________ Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
Huuuh? Python is serverside(Zope), Javascript is clientside (browser). Your question is very much a HTML/Javascript question but not a Zope related question. Of course you can generate generic Javascript code using DTML/ZPT. -aj --On Dienstag, 29. Juli 2003 8:28 Uhr +0100 Exteam <exteam6@yahoo.co.in> wrote:
Hi all, I have some variables in python (getting from DB), now what is the best way to access these variables in javascript? For example, i want to populate person name , city & street which are separate textboxes. If i change the person name, the city & street should automatically change by using javascript onChange event. Are there any examples on the web in this approach?
Thanks Harish
________________________________________________________________________ Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Try to generate some arrays with all your data from server side scripting (dtml or python) Something like : <script language="javascript"> <!-- var arrPersons = new Array(); <dtml-in "getPersonsList()"> arrPersons[<dtml-var sequence-index>] = new Array(<dtml-var name>, <dtml-var city>, <dtml-var street>); </dtml-in> //--> </script> In this way you load all your data in an array and when the event "onchange" is fired, call a function that will look for data in this array. Of course you must handle sepcial characters (you must escape ', ", \ ) ... Hope this will help Dragos ----- Original Message ----- From: "Exteam" <exteam6@yahoo.co.in> To: <zope@zope.org> Sent: Tuesday, July 29, 2003 10:28 AM Subject: [Zope] python variables in javascript
Hi all, I have some variables in python (getting from DB), now what is the best way to access these variables in javascript? For example, i want to populate person name , city & street which are separate textboxes. If i change the person name, the city & street should automatically change by using javascript onChange event. Are there any examples onthe web in this approach?
Thanks Harish
________________________________________________________________________ Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Andreas Jung -
Dragos Chirila -
Exteam