CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 echo label issues

Print topic Send  topic

Author Message
nyblk

Posts: 12
Posted: 07/26/2015, 9:19 AM

I have a little piece of code that I am trying to figure out it works perfect with one issue

I have a reset pass set up and it works good my issue is that I have a label that is called message and if success I want the message to post

$resetpass->Errors->addError("Request processed successfully. Please check your email.");
$resetpass->email->SetValue("");

} else {
$resetpass->Errors->addError("There is no account with that email address.");


}
}

works great but I have to keep the same color as errors so I have a blank label and have tried this


$resetpass->message->SetValue("Request processed successfully. Please check your email.");
$resetpass->email->SetValue("");

} else {
$resetpass->Errors->addError("There is no account with that email address.");


}
}

but the message wont show.. ive tried to echo this but get errors

$resetpass->message->SetValue("Request processed successfully. Please check your email.");
View profile  Send private message
nyblk

Posts: 12
Posted: 07/26/2015, 11:02 AM

Anyone?
View profile  Send private message
eratech


Posts: 513
Posted: 07/28/2015, 7:35 AM

nyblk - you might try SetText() instead of SetValue(). That sometimes comes up in labels.

I'm interested that the email is actually sent, as adding an Error to the Record usually stops the processing and refreshes the page with the error message and input values showing.

One method I use (in a header file with a menu) is to have a label that is populated with a Session variable with the message I want to show, and then after Output of the Header message, the Session value is cleared. This allows me to show messages like 'Item saved' on the redirected page (or same page) and I have 2 message functions - one for Message (green style) and an Error (red style).

Cheers

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
nyblk

Posts: 12
Posted: 07/28/2015, 4:11 PM

yea it didn't work

this works


//REDIRECT USER TO PASSWORD SENT CONFIRMATION PAGE

$resetpass->Errors->addError("Request processed successfully. Please check your email.");
$resetpass->email->SetValue("");

} else {
$resetpass->Errors->addError("There is no account with that email address.");


}
}

but if I style the error block then all messages show red I want a success message to show green I don't know what the issue is but I cannot figure it out
View profile  Send private message
nyblk

Posts: 12
Posted: 07/28/2015, 6:14 PM

I tried this and it does nothing also

//REDIRECT USER TO PASSWORD SENT CONFIRMATION PAGE
this part is my issue
$resetpass->success->SetText("Request processed successfully. Please check your email.");

I have a label in the form name success form name resetpass it does nothing but no errors either



$resetpass->success->SetText("Request processed successfully. Please check your email.");
$resetpass->email->SetValue("");

} else {
$resetpass->Errors->addError("There is no account with that email address.");


}
}
View profile  Send private message
eratech


Posts: 513
Posted: 07/29/2015, 7:24 AM

nyblk - I suspect if there is no error (that is, you have success) the form might be getting reset if there is no error, and just reloads the form if you don't have a Redirect destination on the Record.

You might try passing a querystring flag for success and displaying a message based on the flag.

So instead of
$resetpass->success->SetText("Request processed successfully. Please check your email.");
try adding a flag to the Redirect querystring (eg: 'success=1'), check the CCAddParam function. and then have your success label with Visible 'false' and make it Visible if URL 'success' = 1 or true. Hide-Show Component on the Before Show event of the label.

Let me know how you go

Cheers

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
nyblk

Posts: 12
Posted: 07/29/2015, 9:36 AM

Not sure I follow u can u give me a a example plz?
View profile  Send private message
nyblk

Posts: 12
Posted: 07/30/2015, 7:58 AM

Still no luck
View profile  Send private message
MichaelMcDonald

Posts: 638
Posted: 08/02/2015, 3:10 AM

I agree with Eric, settext for labels and setvalue for fields.

How are you attempting to style the colour?
_________________
Central Coast, NSW, Australia.

View profile  Send private message
MichaelMcDonald

Posts: 638
Posted: 08/02/2015, 3:10 AM

I agree with Eric, settext for labels and setvalue for fields.

How are you attempting to style the colour?
_________________
Central Coast, NSW, Australia.

View profile  Send private message
nyblk

Posts: 12
Posted: 08/02/2015, 6:46 AM

<div class="alert alert-danger">
<span>{Error}</span>
</div>

using css

I have tried settext on label and all it does is add the email address to the input box when submitted


if tried

$resetpass->label->SetText("Request processed successfully. Please check your email.");
$resetpass->email->SetValue("");


//REDIRECT USER TO PASSWORD SENT CONFIRMATION PAGE

$resetpass->Errors->addError("Request processed successfully. Please check your email.");
$resetpass->email->SetValue("");

} else {
$resetpass->Errors->addError("There is no account with that email address.");


}
}
View profile  Send private message
nyblk

Posts: 12
Posted: 08/02/2015, 9:36 AM

nothing is working not even redirect all


//REDIRECT USER TO PASSWORD SENT CONFIRMATION PAGE


$Redirect = "index.php";
} else {
$reset->Errors->addError("There is no account with that email address.");


}
}
View profile  Send private message
nyblk

Posts: 12
Posted: 08/02/2015, 4:34 PM

ok well I'm assuming something is wrong some where nopthing works on this page I cannot even redirect for one small feature its impossible to add

$Redirect = "PasswordSent.php";
} else {
$reset->Errors->addError("email not found!");
}
}

does not redirect
View profile  Send private message
pbarkley

Posts: 37
Posted: 08/02/2015, 6:32 PM

Not sure if you're aware of this, but you need to put this in the header area of any event where you're trying to redirect:

global $Redirect;

If you can't get a simple redirect to work, this might be the problem. Not sure I can help with anything else, but I've burned myself repeatedly on this little issue.

Good luck!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.