Note that there are some explanatory texts on larger screens.

plurals
  1. POForm validation in an HTA file
    primarykey
    data
    text
    <p>How can I perform a simple validation on this HTA form to make sure that data is inputted and an option is selected? This should be simple, I'm not sure what I'm missing.</p> <p>Any answers or suggestions would be appreciated.</p> <p>Thanks.</p> <pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;Write data to text file&lt;/title&gt; &lt;HTA:APPLICATION border="thin" borderStyle="normal" caption="yes" maximizeButton="no" minimizeButton="yes" showInTaskbar="yes" innerBorder="yes" navigable="yes" scroll="auto" scrollFlat="yes" /&gt; &lt;script language="javascript"&gt; window.resizeTo(480,150) function Writedata() { var fso = new ActiveXObject("Scripting.FileSystemObject"); var write_id; write_id = document.getElementById('write_id').value ; alert('The data has been written to \n' + write_id); var s = fso.OpenTextFile(write_id, 8, true); s.WriteLine(document.getElementById('name_id').value); s.Close(); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table&gt; &lt;tr&gt; &lt;h3&gt;Input some information&lt;/h3&gt; &lt;form&gt; &lt;td&gt;Input: &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="name" value="" id="name_id"&gt;&lt;/td&gt; &lt;td&gt;&lt;select id="write_id"&gt; &lt;option name="write" value=""&gt;Select an Option&lt;/option&gt; &lt;option name="write" value="C:\temp\option1.txt"&gt;Option1&lt;/option&gt; &lt;option name="write" value="C:\temp\option2.txt"&gt;Option2&lt;/option&gt; &lt;/select&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="button" onclick="Writedata()" value="submit"&gt;&lt;/td&gt; &lt;/form&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload