Passing string parameter to Javascript using field_key

Talk about link fields or link implementations

Moderator: alexandrleonenko

Buzz Brown
Senior
Senior
Posts: 41
Joined: Apr 18th, '10, 09:47
Location: Auburn Hills, MI

Passing string parameter to Javascript using field_key

Postby Buzz Brown » Nov 26th, '10, 15:28

When using type=link for view mode how do I pass a parameter as a string to my Javascript function. The field named "LinkID" is text.

"Name" => array("header"=>"Name", "type"=>"link", "field_key"=>"LinkID", "field_data"=>"Name", "on_js_event"=>"onclick='popitup({0})'", "href"=>"javascript:void(0)", "align"=>"left", "width"=>"20%", "visible"=>"true", "wrap"=>"nowrap", "text_length"=>"-1"),

Javascript function:

"function popitup(muni) {
newwindow=window.open('municipaldata_level1.php?MuniID=' + muni,'name','height=500,width=700,left=50px,menubar=yes,status=yes,location=yes,toolbar=yes');
if (window.focus) {newwindow.focus()}
return false;
}"



Return to “Field type: "link"”