Problem with passing <input type=hidden value='<dtml-var nbMenu>' name=nbMenu> from an external Method
Hi all, Source code of SaveMenu.html <dtml-var "SaveMenu(REQUEST=REQUEST)"> Source code of the external method SaveMenu def SaveMenu(self, REQUEST=None): s="" i = 1 s = s +"<input type=hidden value='<dtml-var nbMenu>' name=nbMenu>" return s And here is the code returned when SaveMenu is executed: <input type=hidden value='<dtml-var nbMenu>' name=nbMenu> instead of value='<dtml-var nbMenu>' I should have value=(an integer) Is there an alternative solution to fix that problem? Many Thanks, Yannick
servel yannick wrote:
Hi all,
Source code of SaveMenu.html
<dtml-var "SaveMenu(REQUEST=REQUEST)">
Source code of the external method SaveMenu
def SaveMenu(self, REQUEST=None): s="" i = 1 s = s +"<input type=hidden value='<dtml-var nbMenu>' name=nbMenu>" return s
And here is the code returned when SaveMenu is executed:
<input type=hidden value='<dtml-var nbMenu>' name=nbMenu>
instead of value='<dtml-var nbMenu>' I should have value=(an integer)
Is there an alternative solution to fix that problem?
Many Thanks,
Yannick
try: s = s +'<input type=hidden value="%s" name=nbMenu>' % REQUEST.nbMenu Assuming nbMenu is in REQUEST. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Hi Servel, servel yannick wrote:
Hi all,
Source code of SaveMenu.html
<dtml-var "SaveMenu(REQUEST=REQUEST)">
Source code of the external method SaveMenu
def SaveMenu(self, REQUEST=None): s="" i = 1 s = s +"<input type=hidden value='<dtml-var nbMenu>' name=nbMenu>" return s
And here is the code returned when SaveMenu is executed:
<input type=hidden value='<dtml-var nbMenu>' name=nbMenu>
instead of value='<dtml-var nbMenu>' I should have value=(an integer)
Is there an alternative solution to fix that problem?
Its clearly: def SaveMenu(self, REQUEST=None): return('<input type="hidden" value="%s" name="nbMenu">' % nbMenu) 1) what are you doing with i = 1 here? 2) sure to have nbMenu in the methods namespace? Regards Tino
participants (3)
-
Casey Duncan -
servel yannick -
Tino Wildenhain