Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Javascript trouble with Templates

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
carlosvictorica
Smarty Rookie


Joined: 30 Jan 2004
Posts: 13
Location: Salamanca, Guanajuato, México

PostPosted: Tue Feb 10, 2004 7:57 pm    Post subject: Javascript trouble with Templates Reply with quote

hi, let me describe my app before take a look to this problem.

- I'm using html_options to load a set of values, then i want to display the selected item in the document helped by Javascript function, i want to this with Javascript and not PHP because of waste of bandwidth . When the user clicks on a link that says "ADD" it calls a JS function inside the template.

The Javascript works good, but the only thing is that i cannot access to the select object properties, this is it :

Code:

function AgregaRenglon(form,Tabla){
theTable = document.getElementById(Tabla)
id_prod = form.document.getElementById("producto")
cant = form.document.getElementById("cantidad")
prd = id_prod.options[id_prod.selectedIndex].text // COULD NOT ACCESS


In the last line of code is where i cannot get the value of the selected option, the browser sends me an error.

I know that this is not a JS forum, but because of smarty i have to deal with these issues, cause this example worked good on plain HTML file...

Can i have some help ?
_________________
Don't wash your dirty underwear in public
Back to top
View user's profile Send private message
carlosvictorica
Smarty Rookie


Joined: 30 Jan 2004
Posts: 13
Location: Salamanca, Guanajuato, México

PostPosted: Tue Feb 10, 2004 10:47 pm    Post subject: Reply with quote

So sorry , i got the problem done ...
it was an ambiguous html element id. So it was returning me the data from another element, not the select element ...

What a dumb ass ...
by the way, what software tools do u recommend the most , you know for HTML , Smarty and PHP ....

I'm using Dreamweaver for the Templates and Zend Studio for the code ...

Thanks and sorry.
_________________
Don't wash your dirty underwear in public
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP