Jump to content

Help with syntax needed


n33dl3

Recommended Posts

You will first need to make sure that the page is being processed as php, i.e. it has the .php extension. If so try this:

 

opener.document.getElementById('version').value="<?php echo $version; ?>";

 

also if you have short tags enabled you could also do it this way.

 

opener.document.getElementById('version').value="<?=$version; ?>";

Hi thanx for replaying,

 

With regards to your answer, I am already in PHP my intention is to put the whole statement into one variable like this:

$button_save              =

                '<input class="button" type="submit" name="save_new_case_version" value="save" onClick="opener.document.getElementById(\'aer_version\').value=\'$version\';self.close();" />';

 

The $version variable is set.

This is not working because I have an error with the value statement (marked red) somehow I have set the ' ' or the " " wrong maybe you have an idear how it should be done right.

Thanx

Regards

RobH

  • 2 weeks later...

when strings in php are surrounded by single quotes, the php variables within them will not be translated to their value:

'<input class="button" type="submit" name="save_new_case_version" value="save" onClick="opener.document.getElementById(\'aer_version\').value=\'$version\';self.close();" />';

break the $version out using concatenation:

 '<input class="button" type="submit" name="save_new_case_version" value="save" onClick="opener.document.getElementById(\'aer_version\').value=\'' . $version . '\';self.close();" />';

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.