CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Show image in record from entered filed

Print topic Send  topic

Author Message
Gena

Posts: 591
Posted: 12/14/2015, 2:57 PM

I am using CCS5

So I have a field to store image full file name: foto_filed

I have a Record where I want to put this field as a text box so user can enter a file name.

After that I would like to show Image itself (so to show image from typed foto_filed)

On Record load I would like to show image: this is simple - I need just to add IMG contol and use my foto_filed ?

what is the easiest way to show new typed image name???
_________________
Gena
View profile  Send private message
eratech


Posts: 513
Posted: 12/15/2015, 3:20 AM

Gena

Yes you are correct - use a Form Image control and you can set the control data source to the name of the file and it will use that (text boxes show the text by default, images display the image based on the file name in the datasource)

See the Forms > Controls > Add Image to get the CCS5 control. I usually go with the CCS Control as I can change the visiblity and link properties if I want.

If you go with a plain html IMG tag you would need to put a label in the SRC and point the label at the foto_filed db column as it's datasource (which would work too):
<img src="{foto_filed}">

Cheers

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

Posts: 591
Posted: 12/15/2015, 5:19 AM

Quote eratech:
Gena

Yes you are correct - use a Form Image control and you can set the control data source to the name of the file and it will use that (text boxes show the text by default, images display the image based on the file name in the datasource)

See the Forms > Controls > Add Image to get the CCS5 control. I usually go with the CCS Control as I can change the visiblity and link properties if I want.

If you go with a plain html IMG tag you would need to put a label in the SRC and point the label at the foto_filed db column as it's datasource (which would work too):
<img src="{foto_filed}">

Cheers

Eric

Thanks Eric, this is correct.

But my question was about this:

I have a Record where I want to put this field as a text box so user can enter a file name.

After that I would like to show Image itself (so to show image from typed foto_filed),
so dynamically - user enterd file name and we show it right away in the IMG control...
_________________
Gena
View profile  Send private message
Gena

Posts: 591
Posted: 12/15/2015, 6:02 AM

How to dynamically SHOW image using the “value” of foto_filed input field after in was typed in
_________________
Gena
View profile  Send private message
MichaelMcDonald

Posts: 636
Posted: 12/19/2015, 2:30 PM

Not sure if this exactly will help but maybe....

Jquery has some good functions like on some event trigger submit button, etc.


Is this something where user could enter text into input, then using onmouseleave event or onlosefocus of the input perhaps could trigger click a submit button to run php code by ajax call to this page or another to show image?
_________________
Central Coast, NSW, Australia.

View profile  Send private message
eratech


Posts: 513
Posted: 12/21/2015, 7:22 PM

Gena - I suspect you are missing a step in the process.

If you want the user to type the file name eg: "mysample.jpg", and then see it on the screen, where is the image located when they type the name? Is it still on their local computer? Or has it been uploaded by them through some other AJAX loader?

If the image hasn't been loaded to the server, you won't be able to reference it in the IMG tag (using jquery or otherwise)

If it's already on the server then you can certainly show it in IMG when the form is shown.

Thanks

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
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.