When I looked up the textarea tag in some of my references I don't see a value property. I think you may be running into an issue because of this. It is a block area who's 'value' is between the tags. But I see you have a similar line commented out, so what is the deal there? Does it work with innerHTML?
When I looked up the textarea tag in some of my references I don't see a value property. I think you may be running into an issue because of this. It is a block area who's 'value' is between the tags. But I see you have a similar line commented out, so what is the deal there? Does it work with innerHTML?
When is myreq defined? If its in the document you would have to ref the document as well.
Dear burnme, thanks for the reply.
No, It displays the same error with innerHTML!
I think, make a mistake in textarea (myreq) definition.
It is defined as below:
<label for="myreq">Req String</label><br><textarea id="myreq" rows="15" cols="66"></textarea><br><br>
I don't know which line of code should I modify for this error?
Okay, here is the deal, I took out all your OCX code and it works just fine, SO something is happening with that. That's the best I can say, I don't have access to your OCX, but it has to be that. Here is the code I used, with the stuff taken out. If you want help on the OCX code, I am well versed in MANY other languages, so it you have somewhere you want to put it, I would be happy to help you out there.
Edit: I would copy and paste this into a test.html file and run it, I just put crap in the boxes, but all is well without the ocx parts.
The problem is resolved!
It was because of adding some lines to display the function's return value in the document.
Now, I have another question please!!
As you know, we don't have Array type property in MFC ActiveX control (I'm using Visual C++ 2008) and I don't have any experience in using VARIANT type.
In another function of my activex, I want to assign an array of strings (of type CStringArray) to a custom array property and then, get and parse this string array (property returned from activex) in javascript code to show all of these strings in a list at html page.
I have no idea that how should I do this work?
I've searched so much, but didn't find any working solution!
Well I guess I don't quite get the question but I may have an idea of what you are talking about. If I am correct about what you need, I think you could simply do .toString on your array in the ocx, so it is one big chunk of characters with a delimiter i.e. comma, pipe, or whatever, then simply have javascript do a split on the values. I personally don't like to do to much 'special' stuff when passing from one language/platform to another, too much can go wrong, but characters are almost always cheap and easy. Take a look at this pages, do the same thing you did with the function I have already worked with, by passing out the info you want like "myval1,myval2,myval3,myval4", then in your javascript just:
Code:
function GiveMeMyStuff(mystuff){
var n = mystuff.split(",");
var blah = n[0]; //which is myval1 and so on, just the same as most any language
}
Bookmarks