Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Numbers entered in text box changing when back button clicked

Hi all ... I've got a weird one.  Need an answer quite quickly, so I thought I'd put it out there on the forum to see if anyone can spot whatever idiot thing I'm doing while the tech support guys and girls are sleeping (don't ya love time zones).

I have a free format question, collecting home and mobile phone number, and email address.  I am collecting the phone numbers in text boxes, and then using validation.

Here's my HTML ...
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
  <td width="25%"> <b>Home phone:</b> (Please enter 10 digits including area code) </td>
  <td> <input name="B4_home" id="B4_home" type="text" size="15"> </td>
</tr>
<tr>
  <td> <b>Mobile:</b> (Please enter 10 digits)</td>
  <td> <input name="B4_mobile" id="B4_mobile" type="text" size="15"> </td>
</tr>
<tr>
  <td> <b>Email :</b> </td>
  <td> <input name="B4_email1" id="B4_email1" type="text" size="10">&nbsp;<font size="5">@</font>&nbsp;<input name="B4_email2" id="B4_email2" type="text" size="20"> </td>
</tr>
</table>


and here's my validation (the client wants at least one form of contact to be given):

var lena = ((document.mainform["B4_home"].value).length);
var lenb = ((document.mainform["B4_mobile"].value).length);
var vala = SSI_GetValue("B4_home");
var valb = SSI_GetValue("B4_mobile");
var c1 = ((document.mainform["B4_email1"].value).length);
var c2 = ((document.mainform["B4_email2"].value).length);


if(lena == 0 && lenb == 0 && c1 == 0 && c2 == 0)
{
    strErrorMessage = "Please provide at least one method of contact."

}

if(c2 > 0 && c1 == 0)
{
    strErrorMessage = "Please enter your full email address - there is something in the box after the @ symbol but nothing in the one before it.";
}
if(c1 > 0 && c2 == 0)
{
    strErrorMessage = "Please enter your full email address - there is something in the box before the @ symbol but nothing after that.";
}

if(lenb > 0 && isNaN(valb))
{
    strErrorMessage = "Please check your mobile phone number - don't use any letters or symbols.";
}
if(lenb > 0 && lenb < 10)
{
    strErrorMessage = "Please check your mobile phone number - there should be 10 digits.";
}

if(lena > 0 && isNaN(vala))
{
    strErrorMessage = "Please check your home phone number - don't use any letters or symbols.";
}
if(lena > 0 && lena < 10)
{
    strErrorMessage = "Please check your home phone number - there should be 10 digits.  Please include your area code.";
}


Validation appears to work just fine - at least one method must be given, phone numbers must be 10 digits in length, with no symbols or letters.  What happens though is that the number changes!!!  So if I put (0425)224012 in a box, it correctly tells me that there are symbols there.  All good.  but if I put 0425224012 in, hit the submit button, and then go back, the number has changed to 72689674.  

So what am I missing?  It's driving me nuts!!  This is all on 8.2.4.
asked Jul 22, 2014 by Marion Bronze (3,435 points)

1 Answer

0 votes
This sounds like one of the bug fixes corrected in v8.3.2 Marion.

Review the version notes at ...

http://www.sawtoothsoftware.com/support/downloads/94-support/software-downloads/657-download-ssi-web#version-history.

See point 6.

There are a variety of bug fixes associated to O/E and numeric input.

It may pay to update your version to v8.3.6? Be careful of the version upgrade if you have current jobs in the field.
answered Jul 22, 2014 by Paul Moon Platinum (63,820 points)
Thanks Paul.  We absolutely always have jobs in field, hence the delay in upgrading :-)
And, for the sake of those playing at home, the upgrade worked.  So the problem was, indeed, to do with the bug.  (Lovely chatting with you, Mr Moon)
...