Hi Anthony, I am able to achieve it through Javascript function like below:
function submitVlaue(thisForm) { var recordName = thisForm.name_text_field.value; window.location="{{=URL('default', 'recordr_config') + '/'}}" + recordName ; } but if I use JQuery instead of directly putting record name, its not working.Please suggest is it a proper way to send the parameters to the controller function. Regards, Amit On Thu, Aug 30, 2012 at 2:44 PM, Amit <amit.khaw...@gmail.com> wrote: > Anthony, > I observe one more thing, as I have launched record Info page from other > page using below statement: > > <Button type="button" name ="setting_button" id="setting" > disabled="disabled" > onClick = 'window.location="{{=URL('default', 'record_config', > args=[row.record_id])}}";'> > > > So upon clicking on button , it is launching record_config page , first it > will call record_config() function and I am passing record_id to fetch the > data about the record and display on the record_config page , so > record_config page will display all data about the record( for e.g > record_id, record_name etc...) > > Now what is my observation is : the URL of record_config page, it is > showing like: > > http://127.0.0.1:8000/record_App/default/record_config/45326699 > > where the number (45326699) indicates the record_id. > > One test i have done : > I have written one javascript function with alert message and calling from > onclick of the save button on the record_config page, but it is not > invoking the javascript function so I am suspecting the above URL is > different from record_config page, may be some temporary page is getting > created with these values. > > what I understood is this page is not record_config page that's why it is > not calling onclick of the button , hence not calling javascript, JQuery > stuffs also. > > Please provide your inputs on this. > > Regards, > Amit > > > On Thu, Aug 30, 2012 at 2:11 PM, Amit <amit.khaw...@gmail.com> wrote: > >> Still the same issue :( , its not calling record_config() function... >> how to check whether JQuery is supported or not? I have created my own >> custom html page without mentioning {{extend 'layout.html'}} statement, >> means simple html page withe labels and text fields, so do I need to add >> some statement in my html file to support JQuery? >> >> >> On Thu, Aug 30, 2012 at 12:40 PM, Anthony <abasta...@gmail.com> wrote: >> >>> Replace the single quotes with double quotes inside the jQuery(): >>> >>> onClick='window.location="{{=URL('default', 'record_config') + '/'}}" + >>> jQuery("input[name=name_text_field]").val();' >>> >>> The value will be available as request.args(0) in the record_config() >>> function. >>> >>> Anthony >>> >>> >>> On Thursday, August 30, 2012 2:41:40 AM UTC-4, Amit wrote: >>>> >>>> Hi Anthony, >>>> I used the code which you have suggested but it's not working at all, >>>> it is not calling record_config() function of controller. >>>> >>>> <input value="Save" type="button" name="save_button" >>>> onClick='window.location="{{=**URL('default', 'record_config') + '/'}}" >>>> + jQuery('input[name=name_text_**field]').val();'> >>>> >>>> >>>> second point is if the above approach is successful then how would I >>>> retrieve the value in controller side: >>>> >>>> def record_config(): >>>> print 'inside record_config' >>>> print request.input['name'] >>>> >>>> Do I need to use Input list to retrieve the value? OR is there any >>>> other way to retrieve? >>>> >>>> >>>> On Wednesday, 29 August 2012 19:50:15 UTC+5:30, Anthony wrote: >>>>> >>>>> <Button type="button" name ="seeting_button" >>>>>> onclick = 'window.location="{{=URL('defa**ult', 'record_config', >>>>>> args=[name_text_field.value])}**}";'> >>>>>> >>>>> >>>>> You cannot refer to name_text_field the way you have. Everything >>>>> inside {{..}} is Python and must be available on the server before the >>>>> HTML >>>>> is rendered and sent to the browser. The input field value is available on >>>>> the client side and must be retrieved via Javascript. You could do: >>>>> >>>>> onclick='window.location="{{=**URL('default', 'record_config') + '/'}}" >>>>> + jQuery('input[name=name_text_**field]').val();' >>>>> >>>>> Anthony >>>>> >>>> -- >>> >>> >>> >>> >> >> > --