Hi,
Trying to learn the order of things in NetSuite scripting.
Outside NetSuite I can just create an html file that calls various javascripts functions either from within the html file or external js files.
In NetSuite: (please help me understand the standard process)
- you create a portlet (in my case)
- you can use nlapiResolveURL() to take you to another .js Suitelet
- where does the html fits in - if in the previous step you have to call a specific function? Does it have to be integrated in the js function like this:
function demoList(request, response) { var HTML = "<html><head></head><body>"; HTML = HTML + "<table><tr><td align='right'>......"; response.write(HTML); } ? ? ?_________________________________________________________________ The following is a standalone html that uses "getElementById" to get input from the html portion... how would this be accomplished if I were to do it as a Suitelet??? Here is the code in my "CalcAverage.html": <script type="text/javascript"> //following function will check 2 user input fields and calculate the average function assign() { var examA = document.getElementById('score1').value; var examB = document.getElementById('score2').value; average = ((parseInt(examA) + parseInt(examB)) / 2); document.getElementById("SubButton").value="Score!"; //change text of button document.getElementById('autoavg').innerHTML = average; // change text of field return average //return the average total } </script> <p>Welcome to the site:</p> Exam A Score:&nbsp &nbsp <input type='text' id='score1' NAME="ExamA:" value='' /><p> Exam B Score:&nbsp &nbsp <input type='text' id='score2' NAME="ExamB:" value='' /><p> <p id='para'>The Average is: &nbsp <b id='autoavg'> </b> </p> <input type='button' onclick='assign()' id="SubButton" value='Get Scores'/> thanks for your help.