<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Input field forces restart instead of update]]></title><description><![CDATA[<p dir="auto">Hi, I’ve just recently started with using raspberry pi and started with magic mirror.<br />
I created a module through the template provided, with the use for adding an input field.</p>
<p dir="auto">I’ve been running into an issue of each time I press the enter key on the keyboard after entering a text in the filed or just having the empty field, the magic mirror restarts itself and I’m back to square one.</p>
<p dir="auto">This is the code to create it iside the <code>getDom</code> function:</p>
<pre><code>getDom: function() {
   var self = this;
   var wrapper = document.createElement("div");
   
   self.config.form = document.createElement("form");
   self.config.inputbox = document.createElement("input");
   self.config.dropdownFields = document.createElement("select");
    
    self.config.inputbox.setAttribute("type", "text");    
    
    self.config.form.appendChild(self.config.inputbox);
    self.config.form.appendChild(self.config.dropdownFields);
    wrapper.appendChild(self.config.form);    
   
	// If this.dataRequest is not empty
	if (this.dataRequest) {
                   self.getInput();
                   self.getFields();      
	}

	return wrapper;
},
</code></pre>
<p dir="auto">Every time I hit enter it refreshes the whole page.</p>
<p dir="auto">I’ve also added code for action on change:<br />
<code>self.config.inputbox.onchange = function() {self.setVisibile(self.config.dropdownFields)};</code><br />
but even without this code it still<br />
The good news is I can notice that the <code>onchange</code> function works (just before everything is restarted).</p>
<p dir="auto">Does anyone have any idea why this is like that, do I need to change some settings I am not aware of??</p>
<p dir="auto">Thank you for any feedback.</p>
]]></description><link>https://forum.magicmirror.builders/topic/6536/input-field-forces-restart-instead-of-update</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 05:23:34 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/6536.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 09 Feb 2018 14:02:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Input field forces restart instead of update on Mon, 12 Feb 2018 09:45:27 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/ninjabreadman" aria-label="Profile: ninjabreadman">@<bdi>ninjabreadman</bdi></a>, that seems to do the trick for now :)</p>
]]></description><link>https://forum.magicmirror.builders/post/35587</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/35587</guid><dc:creator><![CDATA[joncedimov]]></dc:creator><pubDate>Mon, 12 Feb 2018 09:45:27 GMT</pubDate></item><item><title><![CDATA[Reply to Input field forces restart instead of update on Sat, 10 Feb 2018 02:57:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/joncedimov" aria-label="Profile: joncedimov">@<bdi>joncedimov</bdi></a> If it’s the [enter] causing problems, you may need to <a href="https://stackoverflow.com/questions/29966619/javascript-override-form-onsubmit-event-not-working" target="_blank" rel="noopener noreferrer nofollow ugc">override/disable the <code>onsubmit</code> event listener for the form</a>. It may be that you’re submitting the form, MM has no idea what to do with that data, and so simply displays (reloads) the same page.</p>
]]></description><link>https://forum.magicmirror.builders/post/35434</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/35434</guid><dc:creator><![CDATA[ninjabreadman]]></dc:creator><pubDate>Sat, 10 Feb 2018 02:57:37 GMT</pubDate></item></channel></rss>