CS3 Text Input Boxes losing names on page change

  • cooljoe04
  • Born
  • Born
  • cooljoe04
  • Posts: 4

Post 3+ Months Ago

I have 4 text input boxes that are being used as part of a contact page. When the page loads the first time, it will load showing the correct input field descriptions. (IE: The name box says "Your Name:") When I select the box it will clear the box so that the person can type in their information. If they click a box and then click back out without typing anything, it will reset the box to the correct description again. (IE: The name box will go back to "Your Name:" if nothing is typed.) The problem is that when the person uses the nav bar at the top and clicks to a different page and back again, the box names will all change to their absolute name:

_level0.pages001.bSubmit dot name, _level0.pages001.bSubmit.email etc.

The only code that I can seem to find to correct this:
Code: [ Select ]
_level0.pages001.bSubmit dot name.text = "Your Name:";

will break it clearing out when someone clicks it and forces you to backspace/delete/select etc to clear the box before typing in again.

I have the following code in place (with the "dot"s replaced obviously):

Code: [ Select ]
onClipEvent(load){
_level0.pages001.bSubmit dot name.onSetFocus = function() {
    this.text = "";
};
_level0.pages001.bSubmit dot name.onKillFocus = function() {
    if (this.text == ""){
        this.text = "Your Name:"};
};

_level0.pages001.bSubmit.email.onSetFocus = function() {
    this.text = "";
};
_level0.pages001.bSubmit.email.onKillFocus = function() {
    if (this.text == ""){
        this.text = "Email Address:"};
};

_level0.pages001.bSubmit.phonenumber.onSetFocus = function() {
    this.text = "";
};
_level0.pages001.bSubmit.phonenumber.onKillFocus = function() {
    if (this.text == ""){
        this.text = "Phone Number:"};
};

_level0.pages001.bSubmit.comments.onSetFocus = function() {
    this.text = "";
};
_level0.pages001.bSubmit.comments.onKillFocus = function() {
    if (this.text == ""){
        this.text = "Questions/Comments/Suggestions:"};
};

}
  1. onClipEvent(load){
  2. _level0.pages001.bSubmit dot name.onSetFocus = function() {
  3.     this.text = "";
  4. };
  5. _level0.pages001.bSubmit dot name.onKillFocus = function() {
  6.     if (this.text == ""){
  7.         this.text = "Your Name:"};
  8. };
  9. _level0.pages001.bSubmit.email.onSetFocus = function() {
  10.     this.text = "";
  11. };
  12. _level0.pages001.bSubmit.email.onKillFocus = function() {
  13.     if (this.text == ""){
  14.         this.text = "Email Address:"};
  15. };
  16. _level0.pages001.bSubmit.phonenumber.onSetFocus = function() {
  17.     this.text = "";
  18. };
  19. _level0.pages001.bSubmit.phonenumber.onKillFocus = function() {
  20.     if (this.text == ""){
  21.         this.text = "Phone Number:"};
  22. };
  23. _level0.pages001.bSubmit.comments.onSetFocus = function() {
  24.     this.text = "";
  25. };
  26. _level0.pages001.bSubmit.comments.onKillFocus = function() {
  27.     if (this.text == ""){
  28.         this.text = "Questions/Comments/Suggestions:"};
  29. };
  30. }


I will be editing this as soon as I can get this issue resolved to be able to do some entry checks to ensure a valid email is given, and that the required fields are filled out, so if anyone has any tips or examples to add to that above and beyond this problem it would be greatly appreciated. I haven't looked for those on the site yet, so forgive me if there are some examples floating around here. Just trying to get one thing at a time working, lol.

//edit: I do have the fla uploaded to a server if anyone is able/willing to take a look, but since it is a purchased template that I have chopped apart like Jason, I didn't want to put the link up for all, PM for link if you think it would help! Thanks!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.