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 -> Programming

 add text to the end of a field value before insert

Print topic Send  topic

Author Message
drcox
Posted: 08/07/2004, 1:41 PM

I am trying to combine the following before (or after) a new record is added or an existing record is updated.

$fldURL and Target="_blank"

So, when the record is created the user would enter say, www.codecharge.com and the code would automatically attach the text at the end to result in....

www.codecharge.com Target="_blank"

as the record. Not sure of the syntax. PHP 4 w/templates CC2.07

Thanks!
drcox
Posted: 08/07/2004, 4:14 PM

Sorry, I should have included the code I'm using in the BEFORE INSERT event :

BEFORE INSERT
$tag = "'' Target=''_blank''";
$fldnewurl = $fldlink_url.$tag;


It produces the following result... www.mysite.com' Target='_blank'
Close, but I need the three single quotes to be double quotes. This is my only problem with the code.

Thanks!
drcox
Posted: 08/07/2004, 4:39 PM

:-D GOT IT!!!

Okay, when trying to open a field link in a form place the following code in the form's BEFORE INSERT event.

$tag = "\'\' Target=\'\'_blank\'\'";
$fldnewurl = $fldlink_url.$tag;

Create a new field in your database named newurl. This is where the extended url will be stored. $fldlink_url is the field the user enters their URL into. I tried to do this without an additional field but couldn't get it. At least it works! newurl is a hidden field in the form table.

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.