Answer to "Count field incorrect" error

Results 1 to 2 of 2

Thread: Answer to "Count field incorrect" error

  1. #1
    Jay Seagrave Guest

    Default Answer to "Count field incorrect" error

    I just experienced the error in an update page, and found that it was a data type mis-match error. The DB was looking for currency, the update page was looking for a number, and the user input a string. I fixed it by just accepting text in all three.<BR><BR>What I would like to know is how to write a script that would give the user some usable feedback for errors, like "Please enter a number in the &#039;how much&#039; field"...I tried a Client-side JS, but it won&#039;t execute before the page is sent to the server.....<BR><BR>So there you go -

  2. #2
    Eddie Campbell Guest

    Default RE: Answer to

    Client side JS will happily execute before the page is submitted back to the server. That is the whole point of it. It runs at the client side.<BR><BR>Try something like this (Untested, but it should work)<BR><BR>&#060;Input Type="Text" Name="MyNumber" onblur="checknum(MyNumber)"&#062;<BR><BR>Then have a JS function test the value like this<BR><BR>function checknum(objname) {<BR> var numfield = objname;<BR> if(isNaN(numfield.value)){<BR> alert("Don&#039;t be a git, enter a number");<BR> numfield.focus();<BR> return false;<BR> }else{<BR> return True;<BR> }<BR>}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts