Can't pass data in javascript in link-field [SOLVED]

Talk about link fields or link implementations

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

purlut
Junior
Junior
Posts: 15
Joined: Jul 4th, '09, 04:30

Can't pass data in javascript in link-field [SOLVED]

Postby purlut » Sep 26th, '09, 07:29

That is my used code
1) select
$sql=" SELECT *, concat(foto_dir, '/', foto, '|', breedte, '|', hoogte) as beeld, foto_id as exif FROM ".$_SESSION[ '_fotos_' ];


2) link-field
Column-declaration
"exif" =>array("header"=>"EXIF", "type"=>"link",
"align"=>"left", "width"=>"", "wrap"=>"nowrap", "text_length"=>"-1",
"tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal", "summarize"=>"false",
"sort_type"=>"string", "sort_by"=>"", "visible"=>"true",
"on_js_event"=>"", "field_key"=>"exif",
"field_data"=>"foto_id", "rel"=>"", "title"=>"", "target"=>"_self",
"href"=>"javascript:openeenw({0},'_show_exif.php', 500,400)"),

Note foto_id is field in the used table

2) Javascript:
function openeenw(fo, bestand, br, ho)
{
spec = "resizable=1, width=" + br + ", height=" + ho;
br = br - 40;
ho = ho - 40;
window.open("<? echo $_SESSION[$_SESSION['pregrp']]['subdir']; ?>include_beheer/" + bestand + "?b=" + fo + "&br=" + br + "&ho=" + ho,"mywindow", spec);
}

3) Now I run the php

Image

I put a red frame around the concerned link-field. It also show's the data that should be returned to the javascript.
fields with this data are foto_id or exif
The returned value however is 10229

When I run, I do not get an error !!!
Debugger is on, and no errors are showed

But, When I see the opened window, the firsth parameter isn't the foto_id.
Thus, the call is running, but the field_data isn't passed and I got a wrong one

//localhost/image_data/albumbeheer/include_beheer/_show_exif.php?b=10229&br=460&ho=360

Here a pciture

Image

No where in the table is a field with this content.

What could be wrong ?
Last edited by purlut on Oct 2nd, '09, 03:28, edited 1 time in total.

administrator
Site Admin
Site Admin
Posts: 5975
Joined: Jan 7th, '09, 23:18
Contact:

Re: Can't pass data in javascript in link-field

Postby administrator » Sep 28th, '09, 10:44

1. What version you work with?
2. try to catch what you get in javascript function with
alert(fo+' '+bestand+' '+br+' '+ho);
What do you see?

purlut
Junior
Junior
Posts: 15
Joined: Jul 4th, '09, 04:30

Re: Can't pass data in javascript in link-field

Postby purlut » Sep 28th, '09, 16:58

I use 6.02 pro
In the alert-function, fo has the value of 10229

purlut
Junior
Junior
Posts: 15
Joined: Jul 4th, '09, 04:30

Re: Can't pass data in javascript in link-field [SOLVED]

Postby purlut » Oct 2nd, '09, 03:30

I found the problem, or better, I found a way to pass the problem.
In the intitial javascripts en PHP's, I send some data as string, other as number ...
Now, I put everywhere quotes, so I always pas param as string. I convert if necessary when para's or received and now it works fine.
Anayway, thks for the attention.


Return to “Field type: "link"”