<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1025290" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1025290</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/javascript-form-validation-help#comment-1154218</link>
    <description> &lt;p&gt;why are you using javascript validation? it is extremely easy to bypasss. and is nothing in the way of security.&lt;/p&gt;
&lt;p&gt;if you do it as a precusor to be fast that&#039;s ok, but you should have a server side validation before any insertions, not a client side&lt;/p&gt;
 </description>
     <pubDate>Wed, 30 Jun 2004 20:32:37 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1154218 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/javascript-form-validation-help#comment-1154079</link>
    <description> &lt;p&gt;Thanks for all the help! Abhishek, your advice really helped. Here is the solution I came up with:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;amp;gt;&amp;lt;!--&lt;br /&gt;function checkData () &lt;br /&gt;/* make sure search form doesn&amp;#039;t contain default text and isn&amp;#039;t empty */&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; var input = document.getElementById(&amp;quot;spq&amp;quot;).value;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; if (input == &amp;quot;Search site&amp;quot; || input == &amp;quot;&amp;quot;) &lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(&amp;quot;Please enter a search string.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&amp;quot;spq&amp;quot;).focus();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; /* everything is okay, so return true */&lt;br /&gt;&amp;nbsp; return true;&lt;br /&gt;}&lt;br /&gt;//--&amp;gt;&lt;br /&gt;&amp;amp;lt;/script&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form method=&amp;quot;get&amp;quot; action=&amp;quot;http://search.atomz.com/search/&amp;quot; &lt;br /&gt;name=&amp;quot;search_form&amp;quot; class=&amp;quot;nopad&amp;quot; onsubmit=&amp;quot;return checkData()&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;Search site&amp;quot; size=&amp;quot;12&amp;quot; maxlength=&amp;quot;100&amp;quot; &lt;br /&gt;name=&amp;quot;sp-q&amp;quot; id=&amp;quot;spq&amp;quot; class=&amp;quot;thin&amp;quot; onfocus=&amp;quot;javascript:if(this.value==&amp;#039;Search &lt;br /&gt;site&amp;#039;) {this.value=&amp;#039;&amp;#039;;}&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;amp;nbsp;&amp;lt;input type=&amp;quot;image&amp;quot; src=&amp;quot;images/go_button.gif&amp;quot; align=&amp;quot;top&amp;quot; width=&amp;quot;25&amp;quot; &lt;br /&gt;height=&amp;quot;20&amp;quot; border=&amp;quot;0&amp;quot; alt=&amp;quot;Submit Search&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Mon, 28 Jun 2004 17:02:37 +0000</pubDate>
 <dc:creator>jumpyg</dc:creator>
 <guid isPermaLink="false">comment 1154079 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/javascript-form-validation-help#comment-1153936</link>
    <description> &lt;p&gt;Here&#039;s the thing -- Atomz doesn&#039;t care about blanks, why should you?&lt;/p&gt;
&lt;p&gt;Validate the entry, sure. But if you use the bit I gave you instead of all this, it will automatically remove &quot;Search site&quot; when the field is focussed so you don&#039;t get false returns for those words.&lt;/p&gt;
 </description>
     <pubDate>Sat, 26 Jun 2004 07:21:11 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1153936 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/javascript-form-validation-help#comment-1153928</link>
    <description> &lt;p&gt;Can you set an id for the input element? Something like this might work:&lt;br /&gt;
  &lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;var input = document.getElementById(&amp;quot;spq&amp;quot;).value;&lt;br /&gt;&amp;nbsp; ...&lt;br /&gt;&amp;nbsp; &amp;lt;input ... id=&amp;quot;spq&amp;quot;&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Sat, 26 Jun 2004 03:43:37 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1153928 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/javascript-form-validation-help#comment-1153908</link>
    <description> &lt;p&gt;Hi Suzanne. &lt;/p&gt;
&lt;p&gt;The search box starts off with &quot;Search site&quot; in it. The if statement in the form code:&lt;br /&gt;
&lt;code&gt;onfocus=&amp;quot;javascript:if(this.value==&amp;#039;Search site&amp;#039;) {this.value=&amp;#039;&amp;#039;;}&amp;quot;&amp;gt;&lt;/code&gt;&#039;&lt;br /&gt;
is used so that when a user clicks in the search box, the &quot;Search site&quot; text disappears and they can enter their search. I could do it your way, but I want that text to disappear entirely. That part works okay, and I&#039;ve had that in there for some time. &lt;/p&gt;
&lt;p&gt;I&#039;m not quite sure what you mean by an extra return in the onSubmit. Do you mean that I can have onsubmit=&quot;checkData()&quot; instead of onsubmit=&quot;return checkData()&quot; ? I did take out the return, but I&#039;m still not getting it to work. &lt;/p&gt;
&lt;p&gt;As an experiment, I put an alert in the checkData() function to see if that is executing:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;amp;gt;&amp;lt;!--&lt;br /&gt;function checkData () {&lt;br /&gt;/* make sure search form doesn&amp;#039;t contain default text and isn&amp;#039;t empty */&lt;br /&gt;&lt;br /&gt;var input = document.search_form.sp-q.value;&lt;br /&gt;alert(&amp;quot;in checkdata&amp;quot;);&lt;br /&gt;if (input == &amp;quot;Search site&amp;quot; || input == &amp;quot;&amp;quot;) &lt;br /&gt;{&lt;br /&gt;&amp;nbsp; alert(&amp;quot;Please enter a search string.&amp;quot;)&lt;br /&gt;&amp;nbsp; input.focus()&lt;br /&gt;&amp;nbsp; return false; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* everything is okay, so return true */&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;//--&amp;gt;&lt;br /&gt;&amp;amp;lt;/script&amp;amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
When the alert is right after the var input definition, it does NOT bring up the dialog box. However, if I put the alert right before the var input definition, the alert comes up. I&#039;m thinking it does not like the hyphen in the form input name.&lt;/p&gt;
 </description>
     <pubDate>Fri, 25 Jun 2004 20:47:54 +0000</pubDate>
 <dc:creator>jumpyg</dc:creator>
 <guid isPermaLink="false">comment 1153908 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/javascript-form-validation-help#comment-1153890</link>
    <description> &lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;onfocus=&amp;quot;select()&amp;quot; value=&amp;quot;Search site&amp;quot;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Why do you have another if statement in the form code? And an extra return in the onsubmit?&lt;/p&gt;
 </description>
     <pubDate>Fri, 25 Jun 2004 18:05:09 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1153890 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
