Carrying a value outside of Javascript - Please Help......

laxmig

New Member
Hi - Please help.....

Here is a piece of code that I am working on: This code is in w_links.output procedure.

I want to be able to capture the value of a variable that is inside javascript outside of the javascript with in Webspeed. Can you please let me know how I can do that. The alert shows that the value is stored in w_button and wh_button. But when I do the get-value on the objects it does not have any value in it.

The code is as follows:

DO WITH FRAME {&FRAME-NAME}:

{&OUT} "<input type=hidden name=wh_button VALUE='STOCK'>" SKIP {&END}

{&OUT}
'<script language=javascript>' SKIP
' var w_button ;' SKIP
' function chkRepl(wb_button) ~{' SKIP
' document.forms[0].wh_button.value = "REPL" ~;' SKIP
' w_button = document.forms[0].wh_button.value ~;' SKIP
' alert(document.forms[0].wh_button.value) ~;' SKIP
' alert("This is a test for w_button") ~;' SKIP
' alert(w_button) ~;' SKIP
' alert("This is the second line for wb_button") ~;' SKIP
' alert(document.forms[0].wb_button.value) ;' SKIP
' ~}' SKIP
'</SCRIPT>'
{&END}

l-button = get-value("wh_button").
MESSAGE l-button "after script" get-value('wh_button') get-value('wb_button')
get-value('w_button').

ASSIGN l-dir = "OE"
l-islink = yes
l-res-file = ?
l-ext = "200".
IF l-ext <> "" THEN
{inc\findfile.i}
IF l-res-file <> ? THEN
{&OUT}
"<A HREF=" STRING(l-res-file)
url-field("p-seq-no",STRING(h_seq_no),"?")
" TARGET=main INPUT TYPE=hidden NAME=wb_button VALUE='repl' onClick=' return chkRepl(wb_button);'> Replenishment Order </A><BR>"
SKIP
{&END}

I want to get the value of "REPL" in the variable l-button once the user clicks on the link "Replenishment Order".

Please help me. I am not sure how I can get that value into l-button. The variable l-button is a global variable declared somewhere in the include file as a char variable.

Thanks
Laxmi
 
Simple, you either have to POST the form with the button in it OR add the value you are after to the Query string of the link that is clicked.

Without the POST of QueryString values that reside on the client computer will not be available in WebSpeed (which runs on the server).
 
Back
Top