function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
WitteWitte 

on click javascript, javascript using php

hi,

 

I`ve placed a button and want the bevhavior to make new pupop box.

im using javascript in the javascript im refering to PHP. But the pupop box gives a syntax error.

the code used is:

window.alert(<php echo $result; ?>);

<?php
$from = "abc";
$to = "def";
$amount = 1.00;
$url = "url";
$result = file_get_contents($url);
?>

 

Cant i use php after a button? Can help me wiith this, why the syntax error is displayed?

 

b-Forceb-Force

Where is your button on Standard page / custom Page (VF).

I dont think you can use PHP on click 

 

but you can use window.open(url_string) function with javascript which open this window in popup

 

Thanks,

Bala

WitteWitte

Hi,

 

 

Thnx for your response Bala!.

 

I`ve created an object. Now i want to auto update an input box by clicking on a button.

My button is on a standard page. The first step i need to figure out is how to get information with javascript and php to a alertbox.

 

ive never used url_string function, so i dont know if this is the answer.

 

thnx

Witte

sfdcfoxsfdcfox

You can't use PHP anywhere in Force.com, including custom buttons on standard layouts. Instead, you need to use pure JavaScript. You also need SOA, a feature of AJAX toolkit that allows you to connect across domains through a Force.com-hosted proxy.