JavaScript, Passing Parameters

I have a javascript code that provides a confirmation alert message of Continue or Back. If the end user clicks on the Continue button, a procedure call is then execute which passes multiple parameters. I have searched for a solution on the internet; but I have turned nothing that fits my criteria. Here is a snippet of code that performs the call to the procedure with multiple parameters, but it fails when testing.

 buttons: {
                       "CONTINUE": function() {
                          document.location.href="'||owa_util.get_owa_service_path||'APP_COLES_COLLEGE.PKG_HUGHES_EXCEPTIONS.P_CONTINUE?IN_KSU_ID='||IN_KSU_ID||'
                                                                                                                                        IN_FORCE='||IN_FORCE||'
                                                                                                                                        IN_REASON='||IN_REASON||'
                                                                                                                                        IN_COMMENT='||IN_COMMENT||'
                                                                                                                                        IN_PIDM='||IN_PIDM||'";
                          },
                       "BACK": function() {
                          document.location.href="'||owa_util.get_owa_service_path||'APP_COLES_COLLEGE.PKG_HUGHES_EXCEPTIONS.P_SUBMIT_HUGH_EXCP?IN_KSU_ID='||IN_KSU_ID||'";                        
                          }
                       }
SeaghostAsked:
Who is Participating?
 
ambienceCommented:
This is more than likely HTML/JS embeded in a custom Webbrowser host. The application/host is using its own URL syntax (a mini-language) and trapping events to perform business. It can only work inside the same environment and not in any other host.
0
 
Rainer JeschorCommented:
Hi,
what programming language is this?
This does look like a mixture of Javascript (client) code and some kind of server side code (all the ||).

Parameters in URLs are concatenated using the ampersand - so without knowing the exact impact of the other language it should look like:
buttons: {
                       "CONTINUE": function() {
                          document.location.href="'||owa_util.get_owa_service_path||'APP_COLES_COLLEGE.PKG_HUGHES_EXCEPTIONS.P_CONTINUE?IN_KSU_ID='||IN_KSU_ID||'&IN_FORCE='||IN_FORCE||'&IN_REASON='||IN_REASON||'&IN_COMMENT='||IN_COMMENT||'&IN_PIDM='||IN_PIDM||'";
                          },
                       "BACK": function() {
                          document.location.href="'||owa_util.get_owa_service_path||'APP_COLES_COLLEGE.PKG_HUGHES_EXCEPTIONS.P_SUBMIT_HUGH_EXCP?IN_KSU_ID='||IN_KSU_ID||'";                         
                          }
                       }

Open in new window

But please be aware that you should url encode the parameter values.

HTH
Rainer
0
 
Slick812Commented:
greetings Seaghost, , , you do not tell us enough about the code block you have shown , for us to know what a fix 4 your problem, might be. I looks like a Text Parser , MIGHT, Go through the String in the location herf, and place variable values in every thing between the double bars ||replace_me||, , Except you have this -
      owa_util.get_owa_service_path
this is object oriented syntax, (looks like javascript to me), an Text Parsers Can Not run the OOP, as in a string it's just characters, not an object.

If this is just a Javascript   JSON  Object creation, then you might try this -

buttons: {CONTINUE: function() {
    document.location.href=owa_util.get_owa_service_path+
    'APP_COLES_COLLEGE.PKG_HUGHES_EXCEPTIONS.P_CONTINUE?IN_KSU_ID='+
    N_KSU_ID+'IN_FORCE='+IN_FORCE+'IN_REASON='+IN_REASON+'IN_COMMENT='+
    IN_COMMENT+'IN_PIDM='+IN_PIDM;
    },
    BACK: function() { 
       document.location.href=owa_util.get_owa_service_path+
       'APP_COLES_COLLEGE.PKG_HUGHES_EXCEPTIONS.P_SUBMIT_HUGH_EXCP?IN_KSU_ID='+N_KSU_ID;  
       }
  } 

Open in new window

but there must be JS variables for IN_PIDM,  N_KSU_ID, and  all the rest.
But this -
APP_COLES_COLLEGE.PKG_HUGHES_EXCEPTIONS.P_SUBMIT_HUGH_EXCP
does not look like correct http URL characters. So theres more to this than you tell us.
0
 
SeaghostAuthor Commented:
This was a wonderful solution and it has definitely help in what I was doing.  Thank You
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.