Hi All,
I am trying to use the a5_AJAX_Callback() on a dialog with some limited success.
I have created two pages the first with expression web as below
This works fine, the second page I have created with Alpha code is below
This does not work, I am trying to write back to the textarea id="Questions_Q1"
The callback page is very simple. I have taken the basic one from the examples and used that for a lookup as I said it works fine with page one but not with page two, the callback page is below, can anybody tell me where I am going wrong
I am trying to use the a5_AJAX_Callback() on a dialog with some limited success.
I have created two pages the first with expression web as below
Code:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html><head><title></title> <meta http-equiv=Content-type content="text/html; charset=unicode"> <meta content="MSHTML 6.00.6000.16825" name=GENERATOR> <script type="text/javascript" src="javascript/core.js"></script> <script type="text/javascript" src="javascript/AjaxFormLibrary.js"></script> <script type="text/javascript" src="javascript/aui.js"></script> </head> <body> <p><form method="post"><textarea id=Questions_Q1 name=Q1></textarea></form></p> <p><form method="post"><input type="submit" id="submit2" name="submit2" value="Submit Query" onclick="a5_AJAX_Callback('Questions.Ajax.A5W','action=SayHello&name='+urlencode($('Questions_Q1').value)); return false;" ></form></p> </body></html>
Code:
<html> <head> <base href="file:///C:/Program Files/a5v9/"> <!-- must use in order to make XP Themes render --> <META HTTP-EQUIV="MSThemeCompatible" content="Yes"/> <link rel="stylesheet" type="text/css" href="css/BusinessSchool/style.css"> <link rel="stylesheet" type="text/css" href="css/BusinessSchool/components/a5SimpleForm/style.css"> <script type="text/javascript" src="file:///C:/Program Files/a5v9/javascript/core.js"></script> <script type="text/javascript" language="javascript"> <!-- function Questions_Init(){ }; $e.add(window,'load',Questions_Init); //--> </script> </head> <body class="BusinessSchoolPageBODY"> <form id="QUESTIONS.DIALOG" name="Questions" style="margin: 0px;" method="POST" action=""> <input type="hidden" name="Questions_hidden_test_variable"> <table class="BusinessSchoolFormTABLE" cellspacing="1" cellpadding="2"> <tr> <td class="BusinessSchoolColumnTD"><label id="Questions_DBASENO.L" for="Questions_DBASENO" >dbaseno</label></td> <td class="BusinessSchoolDataTD" > <input id="Questions_DBASENO" size="20" maxlength="20" class="BusinessSchoolInput" type="text" name="DBASENO" value="" /></td> <td class="BusinessSchoolColumnTD"><label id="Questions_GOTOQNO.L" for="Questions_GOTOQNO" >gotoqno</label></td> <td class="BusinessSchoolDataTD" > <input id="Questions_GOTOQNO" size="20" maxlength="20" class="BusinessSchoolInput" type="text" name="GOTOQNO" value="" /></td> </tr> <tr> <td class="BusinessSchoolColumnTD"><label id="Questions_QUESTIONNO.L" for="Questions_QUESTIONNO" >questionno</label></td> <td class="BusinessSchoolDataTD" > <input id="Questions_QUESTIONNO" size="20" maxlength="20" class="BusinessSchoolInput" type="text" name="QUESTIONNO" value="" /></td> <td class="BusinessSchoolColumnTD"></td> <td class="BusinessSchoolDataTD" > <textarea rows="3" cols="50" id="Questions_Q1" class="BusinessSchoolTextarea" name="Q1">This is my lookup Question </textarea></td> </tr> <tr> <td colspan="2" style="padding: 0px" > <table cellspacing="1" cellpadding="3" style="border: none; width: 100%"> <tr><td class="BusinessSchoolDataTD" > <input id="Questions_RADIOBUTTON10.1" type="radio" value="yes " name="RADIOBUTTON10" onclick="" /><label id="Questions_RADIOBUTTON10.1.L" for="Questions_RADIOBUTTON10.1" style="white-space:nowrap;">yes </label> <input id="Questions_RADIOBUTTON10.2" type="radio" value="no" name="RADIOBUTTON10" onclick="" /><label id="Questions_RADIOBUTTON10.2.L" for="Questions_RADIOBUTTON10.2" style="white-space:nowrap;">no</label> </td> </tr> <tr><td class="BusinessSchoolColumnTD"><label id="Questions_RADIOBUTTON10.L" for="Questions_RADIOBUTTON10" >Please Select</label></td> </tr> </table> </td> </tr> <tr> <td class="BusinessSchoolFooterTD" nowrap colspan="4" align="Right"> <input class="BusinessSchoolButton" style="" type="submit" value="Submit" name="submitButton"> <button class="BusinessSchoolButton" style="" name="next" value="AdvancedButton" id="Questions_NEXT" onclick="a5_AJAX_Callback('Questions.Ajax.A5W','action=SayHello&name='+urlencode($('Questions_Q1').value)); return false;" >next</button> <input type="hidden" name="hidden_next" /> </td> </tr> </table> </form> </body> </html>
The callback page is very simple. I have taken the basic one from the examples and used that for a lookup as I said it works fine with page one but not with page two, the callback page is below, can anybody tell me where I am going wrong
Code:
<%a5 dim action as c = default "" if action = "SayHello" then dim myReply as c dim name as c = default "" myReply = lookupc("f","ABC0013","Question","[PathAlias.ADB_Path]\questions","Qno") dim myResponse as c myResponse = "$('Questions_Q1').innerHTML = '" + jsEscape(myReply) + "';" ?myResponse end if function jsEscape as c (txt as c) jsEscape = stritran(txt,"'","\'") jsEscape = stritran(jsEscape,crlf(),"\n") end function %>
Comment