<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="font-size: 14px; ">I would appreciate help from someone who knows Javascript (which I don't). </div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">I'm creating a GUIEdit button that adds a markup expression containing a random number and text containing the same number. </div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">If I select in my edit form:</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">My text</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">and then click my guiedit button, I want a result like this:</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">{(mymarkupexpression 2 "My text")}</div><div style="font-size: 14px; ">The above number is 2</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">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:</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">$num = rand ( 1, 1000 ); </div><div style="font-size: 14px; ">SDVA($GUIButtons, array(</div><div style="font-size: 14px; ">  'mybutton'       => array(8000, "{(mymarkupexpression ".$num." &quot;", "&quot;)}\\nThe above number is ".$num."<a href="smb://n">\\n</a>", '$[Default text if none selected]',</div><div style="font-size: 14px; ">                  '$GUIButtonDirUrlFmt/mybuttonicon.png"$[DoXYZ]"','')</div><div style="font-size: 14px; ">));</div><div style="font-size: 14px; ">$HTMLHeaderFmt['DoXYZ']= <<<EOF</div><div style="font-size: 14px; "><script type='text/javascript'><!--</div><div style="font-size: 14px; ">function DoXYZ() {</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">I IMAGINE THERE IS A WAY TO DO THIS IN JAVASCRIPT</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">  return;</div><div style="font-size: 14px; ">}</div><div style="font-size: 14px; ">//--></script></div><div style="font-size: 14px; ">  </div><div style="font-size: 14px; ">EOF;</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">Thanks,</div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; ">Randy</div></body></html>