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

JS-Variable an smarty übergeben

 
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 -> Language: German
View previous topic :: View next topic  
Author Message
justme69
Smarty n00b


Joined: 17 Mar 2014
Posts: 2

PostPosted: Mon Mar 17, 2014 10:04 am    Post subject: JS-Variable an smarty übergeben Reply with quote

Hallo zusammen,

ich muss innerhalb eines JS eine smarty funktion, bzw. php-Funktion aufrufen. Das geht an diversen Stellen problemlos.
Es bestrifft einen Oxid-Shop.

Nun müsste ich diesem Funktionsaufruf den Inhalt einer JS-Variable als Parameter mitgeben.
Wie mach ich das?

Code:

<script>
    var [b]art_ids[/b] = $('.am_amount_ids');
    ...
    var min = { $oxpr_cmp_utils->get_minOrder_amount([b]art_ids[/b].val()) };
</script>


Mein Problem ist, das ich per Javascript prüfen will, ob der im Formular eingetragene Wert mit dem Minimum übereinstimmt, das in der DB steht.
Also eine Validierung.
Die Fkt get_minOrder_amount liefert mir zu einem Artikeld den Wert aus der DB und der JS-Parameter den aktuellen Artikel der zu prüfen ist.
Den DB-Wert und den aktuell gesetzten muß ich miteinander vergleichen, möglichst ohne die Seite/Formular abzusenden.

Hat jemand Ideen wie's evtl anders geht?

Danke für Infos/Tipps.

MfG
Stefan
Back to top
View user's profile Send private message
justme69
Smarty n00b


Joined: 17 Mar 2014
Posts: 2

PostPosted: Mon Mar 17, 2014 2:23 pm    Post subject: Reply with quote

Ich habs anders gelöst.

Die Ermittlung der Parameter macht PHP, JS überprüft dann nur noch die Werte auf Korrektheit.
War zwar etwas umständlich... funktioniert aber.
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 -> Language: German 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