Can´t display javascript prompt messages (SOLVED)

Hi!, I am actually working with the trial version but if my project works, I’ll need to purchase the full software.

My page isn’t really an eBook, is an DHTML page made with javascript, like an application based on HTML code and javacript.
in some actions, the application prompt for information in order to work with, a numeric quantity. this action works fine on IE7 but doesn’t work with the compiled EXE. what can I do for?

If I understand your request, you want to prompt the end user for some data like a numeric quantity. It can be done with HEScript (thanks to the InputBox function). See instructions and a working sample at
http://www.htmlexe.com/help/samplescript1.htm

when i run this code:

<script type="text/javascript">
function asking_number(){
var case=prompt("how much?","quantity");
}
</script>
<input type="button" onclick="asking_number()" value="Ask" />

any prompt box was displayed, but i realy need to fix this problem because i repeat this line so many times with another variables.

i hope this will have a solution.

You need to verify that your variable names do not clash with Javascript commands.

In your case, you cannot use case as a variable since it used with Javascript’s switch / case statements. Try renaming the case variable to xcase or something else and you will see that the results are more like what you expected.

Later,

sorry, I just was trying to explain an example of the sequence, the original is this:

var caja.debe=];
for(var i=0;i<5;i++){
    caja.debe*=prompt("Ingrese Monto asignado: ",0);
}  

and when I run it on HTMLEXE, nothing happen.

do I need HEScript for this commands?*

Does your code actually work in a IE browser?

Without verifying, I don’t think you can use a period in a variable, more like you can’t use reserved names, as mentioned above.

I would suggest running your code through a JSlint program or website to eliminate all the coding errors. One example is at http://jslint.com. There are others if you seach for them. Doing this will help you with your Javascript syntax.

Notice the warning on the opening page. Warning! JSLint will hurt your feelings.:wink:

Good Luck,

First step: go to the Script Manager, double click on “UserMain” and copy/paste this code in the existing script:

Code:

function AskUser: String;
begin
Result := InputBox("Ingrese Monto asignado:", "Query", "");
end; 

Click “Save Script” and now replace your JS code with:

var caja.debe=];
for(var i=0;i<5;i++){
    caja.debe*=window.external.GetHEScriptCom('usermain.AskUser', '0');
}

Hi!, I was working with the original code and finnaly i disvover the problem, i can’t call the javascript functions using an

but if i put the same call on a works perfectly.

what can i do?

Thanks

Try another JavaScript event to detect when the end user has changed the item in the combobox.

Thanks!, finaly I did solve it changing the onclick event on option tag, with the onkeydown event on the select tag and one auxiliary function between.