Jump to content

How to execute ajaxRequest form TUniHTMLMemo,TUniDBHTMLMemo


kkelchev

Recommended Posts

Hi to all
My case is very simple.
I have runtime filled TUniHTMLMemo ( it is the same with DBHTMLMemo with text replacement inside OnGetText on DataSet Object) 

in some cases in this HTML I need to create button(s) that will execute ajaxRequest back to server.

But IE and other browsers report with error like "ajaxRequest is NOT defined"

I tested same code with simple onclick="alert('bla-bla');" and it work fine.

 

What is necessary to be done to be possible standard UniGUI ajaxRequest call to be executed

 

Thanks

Kamen  

Link to comment
Share on other sites

Thanks
That is content of DB field coming from database;

<div align="right"><font size="4px"><b>006181</b> - ДАВИД xxxxx <br>Лекуваме : <font color="blue">
<b> пулпит 65</b></font> Лекар <b>Д-р Ахмед</b><br><font size="2px">Код диагноза:
<B> #INSSETBTN# </B>
, DiagID:12623</font></div>

#INSSETBTN# - on appserver is replaced and contents of TUniDBHTMLMemo become this:
#INSSETBTN# => <button onclick="ajaxRequest(O47F,'SET_OLD_DIAG_DCID', {});">за уторчнение</button>


<div align="right"><font size="4px"><b>006181</b> - ДАВИД xxxxx <br>Лекуваме : <font color="blue">
<b> пулпит 65</b></font> Лекар <b>Д-р Ахмед</b><br><font size="2px">Код диагноза:
<B> <button onclick="ajaxRequest(O47F,'SET_OLD_DIAG_DCID', {});">за уторчнение</button> </B>
, DiagID:12623</font></div>

Please find attached picture of IE behavior.






 

post-5524-0-01585000-1525697659_thumb.png

Link to comment
Share on other sites

ajaxRequest is fine now , Browser knows what is ajaxRequest

But now I see this


SCRIPT5009: 'O302' is undefined  ...... when press button (ajaxRequest(O302 ,'SET_OLD_DIAG_DCID', {}) ;)

'O302' is JSName of my TUniDBHTMLMemo

So what is right way to specify valid target object that will receive the Ajax request.

Link to comment
Share on other sites

Also:

 

<button onclick="window.ajaxRequest(document.getElementsByName('O302'),'SET_OLD_DIAG_DCID', {});">за уторчнение</button>

 

SCRIPT438: Object doesn't support property or method 'ajaxRequest'

 

What could I do ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...