# Something strange about Input Text Boxes

**URL:** <https://forum.kirupa.com/t/something-strange-about-input-text-boxes/30170>\
**Category:** flash\
**Created:** [September 4, 2003, 6:08pm UTC](https://forum.kirupa.com/t/something-strange-about-input-text-boxes/30170 "2003-09-04T18:08:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tranism](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tranism/32/269_2.png) [@tranism](https://forum.kirupa.com/u/tranism)\
**Post date:** [September 4, 2003, 6:08pm UTC](https://forum.kirupa.com/t/something-strange-about-input-text-boxes/30170/1 "2003-09-04T18:08:47Z")

</div>

Okay, here’s the problem. I have an input text box in my form. Whenever I test the file locally on my machine, everything works. But when I upload the file to my server and test it, the last character is always dropped from the Input text box so I get an error.

My Input text box is for entering a zip code so you must have 5 digits. Say for example I enter “91505”, when I do a trace using php on my server, I notice that only “9150” is being sent to the script, there-by generating an error since that isn’t a valid zip code. Its with any digit, regardless of whether its a 5, 0, 1, etc…, flash only sends the first 4 digits.

Wassup with that???😱

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 4, 2003, 6:10pm UTC](https://forum.kirupa.com/t/something-strange-about-input-text-boxes/30170/2 "2003-09-04T18:10:54Z")

</div>

Did you use any code ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 4, 2003, 6:22pm UTC](https://forum.kirupa.com/t/something-strange-about-input-text-boxes/30170/3 "2003-09-04T18:22:25Z")

</div>

What do you mean? Actionscript for the Input Text box? Yah I did, its in a LoadVars instance . . ., here’s a snipet  
[AS]  
//so i create me LoadVars instance  
formData = LoadVars();  
//then I initialize my formData variables  
formData.txtZip = “”  
//then i gather the information into my LoadVars instance.  
//I used the “escape” thingy hoping that maybe that would help… it didn’t  
formData.txtZip = escape(txtZip.text);  
[/AS]

HELP ME OH FLASH MX GODS!:cowboy:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 4, 2003, 6:30pm UTC](https://forum.kirupa.com/t/something-strange-about-input-text-boxes/30170/4 "2003-09-04T18:30:16Z")

</div>

Did you use a variable for the textfield or did you give it an instance name ?

[AS]formData = new loadVars();  
formData.txtZip = “”;  
formData.txtZip = escape(txtZip.text);[/AS]

Where txtZip is the instance name of your inputfield. Is that all the code you used ? Please post the whole code.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 4, 2003, 6:39pm UTC](https://forum.kirupa.com/t/something-strange-about-input-text-boxes/30170/5 "2003-09-04T18:39:10Z")

</div>

I left the var field in the properties panel empty and just gave the text field an instance name of “txtZip”. Here’s the code  
[AS]  
function onSubmit() {  
//Create a new LoadVars instance for the form data  
formData = new LoadVars();  
//Initialize formData variables  
formData.txtZip = “”;  
formData.cboDist = “”;  
formData.dealer = “stores”;  
//Gather the information into a LoadVars Instance  
formData.txtZip = escape(txtZip.text);  
formData.cboDist = cboDist.getValue();  
formData.dealer = “stores”;

```
//Create another LoadVars instance to receive the server's reply
replyData = new LoadVars();
//Initialize reply variable
replyData.reply_txtZip = "";
replyData.reply_cboDist = "";
replyData.reply_dealer = "stores";
//Specify a function to call when this new instance receives the reply
replyData.onLoad = handleReply;
//Submit the data
formData.sendAndLoad("http://www.fabrizio-gianni.com/fg2003/flash/swfs/zipcodesearch.php", replyData, "POST");
//Telling the user what is happening
scroller.text = "Please wait while your information is being processed. . .";

```

}  
function handleReply(success) {  
if (success) {  
trace(“done loading”);  
scroller.html = true;  
scroller.htmlText = replyData.textfield;  
} else {  
scroller.text = “There was a problem submitting your information. The server my be down or not responding.”;  
}  
}  
[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 4, 2003, 8:08pm UTC](https://forum.kirupa.com/t/something-strange-about-input-text-boxes/30170/6 "2003-09-04T20:08:54Z")

</div>

It was Safari’s fault!. I just tested it with Mozilla, Netscape, AOL, Explorer, and Opera. IT WORKS. It’s just safari that it acts screwy. OH THIS MAKES ME MAD! All those other times when I’ve had strange problems like this may have all just been safari related. :pirate:
