<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Module main page blocking js?</title>
		<link>https://www.cotonti.com</link>
		<description>Neueste Themenbeiträge</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Wed, 15 Apr 2026 06:28:27 -0000</pubDate>

		<item>
			<title>lukgoh</title>
			<description><![CDATA[<blockquote>
<p>Can you please post the full:<br />
 </p>

<p>&lt;form name="form1"&gt;<br />
    &lt;input type="hidden" name="productid" /&gt;<br />
    &lt;input type="hidden" name="command" /&gt;<br />
&lt;/form&gt;<br />
I'm not entirely sure I got the whole idea behind, what you had to put where.</p>

<p>Sorry</p>
</blockquote>

<p> I don't understand what you are trying to do? </p>
]]></description>
			<pubDate>Mi, 15 Mai 2013 03:26:32 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post37503]]></link>
		</item>
		<item>
			<title>Samuel Sloth Andersen</title>
			<description><![CDATA[<p>Can you please post the full:<br />
 </p>

<div class="line number1 index0 alt2" style="line-height:14.296875px;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(34,34,34);margin:0px;padding:0px 1em;border:0px;vertical-align:baseline;background-image:none;width:auto;float:none;height:auto;white-space:pre;"><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">&lt;</code><code class="xml keyword" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(0,102,153);float:none;height:auto;line-height:1.1em;width:auto;font-weight:bold;">form</code> <code class="xml color1" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#808080;float:none;height:auto;line-height:1.1em;width:auto;">name</code><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">=</code><code class="xml string" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#0000FF;float:none;height:auto;line-height:1.1em;width:auto;">"form1"</code><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">&gt;</code></div>

<div class="line number2 index1 alt1" style="line-height:14.296875px;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(34,34,34);margin:0px;padding:0px 1em;border:0px;vertical-align:baseline;background-image:none;width:auto;float:none;height:auto;white-space:pre;"><code class="xml spaces" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;float:none;height:auto;line-height:1.1em;width:auto;">    </code><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">&lt;</code><code class="xml keyword" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(0,102,153);float:none;height:auto;line-height:1.1em;width:auto;font-weight:bold;">input</code> <code class="xml color1" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#808080;float:none;height:auto;line-height:1.1em;width:auto;">type</code><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">=</code><code class="xml string" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#0000FF;float:none;height:auto;line-height:1.1em;width:auto;">"hidden"</code> <code class="xml color1" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#808080;float:none;height:auto;line-height:1.1em;width:auto;">name</code><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">=</code><code class="xml string" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#0000FF;float:none;height:auto;line-height:1.1em;width:auto;">"productid"</code> <code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">/&gt;</code></div>

<div class="line number3 index2 alt2" style="line-height:14.296875px;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(34,34,34);margin:0px;padding:0px 1em;border:0px;vertical-align:baseline;background-image:none;width:auto;float:none;height:auto;white-space:pre;"><code class="xml spaces" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;float:none;height:auto;line-height:1.1em;width:auto;">    </code><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">&lt;</code><code class="xml keyword" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(0,102,153);float:none;height:auto;line-height:1.1em;width:auto;font-weight:bold;">input</code> <code class="xml color1" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#808080;float:none;height:auto;line-height:1.1em;width:auto;">type</code><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">=</code><code class="xml string" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#0000FF;float:none;height:auto;line-height:1.1em;width:auto;">"hidden"</code> <code class="xml color1" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#808080;float:none;height:auto;line-height:1.1em;width:auto;">name</code><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">=</code><code class="xml string" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#0000FF;float:none;height:auto;line-height:1.1em;width:auto;">"command"</code> <code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">/&gt;</code></div>

<div class="line number4 index3 alt1" style="line-height:14.296875px;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(34,34,34);margin:0px;padding:0px 1em;border:0px;vertical-align:baseline;background-image:none;width:auto;float:none;height:auto;white-space:pre;"><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">&lt;/</code><code class="xml keyword" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(0,102,153);float:none;height:auto;line-height:1.1em;width:auto;font-weight:bold;">form</code><code class="xml plain" style="margin:0px;padding:0px;border:0px;font-size:1em;vertical-align:baseline;background-image:none;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:#000000;float:none;height:auto;line-height:1.1em;width:auto;">&gt;</code></div>

<div class="line number4 index3 alt1" style="line-height:14.296875px;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;margin:0px;padding:0px 1em;border:0px;vertical-align:baseline;background-image:none;width:auto;float:none;height:auto;white-space:pre;"><font color="#000000">I'm not entirely sure I got the whole idea behind, what you had to put where.<br />
Sorry</font></div>
]]></description>
			<pubDate>Mi, 15 Mai 2013 00:18:41 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post37502]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	On what page(s)?</p>
<p>
	<strong>Added 5 minutes later:</strong></p>
<p>
	nevermind I see it. Thank you for the report. </p>
<p>
	<strong>Added 14 hours later:</strong></p>
<p>
	This is strange behaviour I think:</p>
<pre class="brush:php;">
if ($usr['isadmin'] == true)
			{
				
				$t-&gt;assign(array(
						'CATEGORY_LINK' =&gt; cot_url('shop', 'm=category'),
						'PRODUCT_LINK' =&gt; cot_url('shop', 'm=product')
					));
					
			}</pre>
<p>
	 </p>
<p>
	and in the tpl file:</p>
<pre class="brush:xml;">
&lt;!-- IF {CATEGORY_LINK} --&gt;
		&lt;li&gt;&lt;a href="https://www.cotonti.com/{CATEGORY_LINK}"&gt;Manage Categories&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="https://www.cotonti.com/{PRODUCT_LINK}"&gt;Manage Products&lt;/a&gt;&lt;/li&gt;
		&lt;!-- ENDIF --&gt;</pre>
<p>
	and yet it not only displays the links when not logged in, but the links are incorrect. </p>
]]></description>
			<pubDate>So, 16 Dez 2012 03:59:54 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36553]]></link>
		</item>
		<item>
			<title>Kingsley</title>
			<description><![CDATA[<p>
	Looks good.. As a guest you see Manage Categories and Manage Products
</p>]]></description>
			<pubDate>So, 16 Dez 2012 02:04:00 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36552]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	Yeah thanks, I always do this just didnt show in code.</p>
<p><strong>Added 7 hours later:</strong></p><p>
	By they way for anyone interested in a shop module (with Paypal) you can check out my progress here: <a href="http://battle-box.net/dev/index.php?e=shop" rel="nofollow">http://battle-box.net/dev/index.php?e=shop</a></p>
<p>
	You need to be logged in to see it:</p>
<p>
	username: guest</p>
<p>
	password: welcome</p>
]]></description>
			<pubDate>Sa, 15 Dez 2012 11:44:07 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36548]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[<p>
	Cool! Don't forget to pay attention to another part tensh's reply:</p>
<blockquote>
	<p>
		By the way, you don't guard the productid value (dunno how about inside the addtocart() function)- it can be potentially dangerous. You should be using cot_import() function IMO.</p>
</blockquote>
<p>
	It is important to sanitize user input (see <a href="http://www.cotonti.com/docs/devel/validation_messages">Validation and Messages</a>) and make sure that unescaped strings are not used in SQL queries (I should probably write in detail about it too).</p>
]]></description>
			<pubDate>Sa, 15 Dez 2012 10:57:07 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36547]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	Yeah thanks Kingsley but I should of payed more attention to tensh's reply, it was just super early and I didn't read it properly. </p>
<p>
	Anyhow, like I said to you the shop module is coming on nicely. Nearly all the basic features are working, including Paypal. Just working on the frontend now, adding stuff like sliders for the featured items.</p>
]]></description>
			<pubDate>Fr, 14 Dez 2012 23:13:32 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36542]]></link>
		</item>
		<item>
			<title>Kingsley</title>
			<description><![CDATA[<blockquote>
	<a href="https://www.cotonti.com/forums?m=posts&amp;p=36538#36538">#36538</a> <strong>lukgoh: </strong><br /><p>
		Yeah you guys are completely right. <strike>I was being dumb</strike>. Thanks.</p>
</blockquote>
<p>
	<em>learning..</em></p>
<p>
	 </p>
]]></description>
			<pubDate>Fr, 14 Dez 2012 19:58:01 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36540]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	Yeah you guys are completely right. I was being dumb. Thanks.</p>
]]></description>
			<pubDate>Fr, 14 Dez 2012 09:58:03 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36538]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[<p>
	The form is missing action and as tensh mentioned it uses GET method. addtocart() should compose a proper action attribute for the form before submitting it. And it would better use POST rather than GET.</p>
]]></description>
			<pubDate>Fr, 14 Dez 2012 09:53:22 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36537]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	I can do it fine without javascript, this is simply a learning experience. The addtocart() function is both a javascript function and php function as seen in my code above. the java script just works the form. This way I only need one form to handle any item rather than needing a form per item.</p>
<p>
	Anyway the issue is the onclick directs back to index.php with the form results like this: index.php?productid=1&amp;command=add and I dont know why.</p>
]]></description>
			<pubDate>Fr, 14 Dez 2012 08:17:01 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36535]]></link>
		</item>
		<item>
			<title>tensh</title>
			<description><![CDATA[<p>
	The addtocart() function is a javascript function, and I think you're trying to invoke it from PHP? This won't work as far as I know. Unless that addtocart() function is also a PHP function :)</p>
<p>
	Also I don't see the method in form, shouldn't it be &lt;form action="(someurl)" name="form1" method="post"&gt;? It seems like it goes as a method="get" by default. I don't know where the adding to cart happens, but if outside the plugin then the form action="" would have to point to the script where the magic happens (in your case the shopping cart plugin).</p>
<p>
	By the way, you don't guard the productid value (dunno how about inside the addtocart() function)- it can be potentially dangerous. You should be using cot_import() function IMO.</p>
<p>
	I will upload my script today for you, you will see how I solved it (without javascript).</p>
]]></description>
			<pubDate>Fr, 14 Dez 2012 07:26:19 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36534]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	This problem is driving me insane trying to solve it. I will try my best to explain. </p>
<p>
	I am trying to build a shopping cart. Categories and products are built with php and each item has an "add to cart" button. I have a single hidden form and js to submit the form. This method works really well for the shopping cart or shop.cart.php (for updating quantities or deleting items) but for some reason it doesn't work at all on shop.main.php it only redirects me to index.php?productid=1&amp;command=add when trying to add items. I have tried everything I can think of. </p>
<pre class="brush:php;">
$js = 'function addtocart(pid){';
$js .= 'document.form1.productid.value=pid;';
$js .= 'document.form1.command.value="add";';
$js .= 'document.form1.submit();';
$js .= '}';

cot_rc_embed($js);


if($_REQUEST['command']=='add' &amp;&amp; $_REQUEST['productid']&gt;0){
		$pid=$_REQUEST['productid'];
		addtocart($pid,1);
		cot_redirect(cot_url('shop', 'm=cart', '', true));
		exit();
	}

'PRODUCT_ADD' =&gt; cot_inputbox('button', '', 'Add to Cart', array('onclick' =&gt; 'addtocart('.$rowproducts['product_id'].')'))</pre>
<p>
	That is a snippet of my shop.main.php but its the only part that isn't working properly. </p>
<pre class="brush:xml;">
&lt;form name="form1"&gt;
	&lt;input type="hidden" name="productid" /&gt;
    &lt;input type="hidden" name="command" /&gt;
&lt;/form&gt;</pre>
<p>
	from the tpl.</p>
<p>
	 </p>
<p>
	Any help would be much appreciated! </p>
<p>
	Luke.</p>
]]></description>
			<pubDate>Fr, 14 Dez 2012 00:03:29 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7268&d=0#post36533]]></link>
		</item>
	</channel>
</rss>