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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.