I would appreciate help from someone who knows Javascript (which I don't). 

I'm creating a GUIEdit button that adds a markup expression containing a random 
number and text containing the same number. 

If I select in my edit form:

My text

and then click my guiedit button, I want a result like this:

{(mymarkupexpression 2 "My text")}
The above number is 2

Here's approximately what I've written to do this. Unfortunately, what I wrote 
uses the same number for each page load rather than for each button click. I 
want the number to change with each button click:

$num = rand ( 1, 1000 ); 
SDVA($GUIButtons, array(
  'mybutton'       => array(8000, "{(mymarkupexpression ".$num." "", 
"")}\\nThe above number is ".$num."\\n", '$[Default text if none 
selected]',
                  '$GUIButtonDirUrlFmt/mybuttonicon.png"$[DoXYZ]"','')
));
$HTMLHeaderFmt['DoXYZ']= <<<EOF
<script type='text/javascript'><!--
function DoXYZ() {

I IMAGINE THERE IS A WAY TO DO THIS IN JAVASCRIPT

  return;
}
//--></script>
  
EOF;

Thanks,

Randy
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply via email to