Hi Nashry,

Why don't you call a js method onClick, that would do an ajax call (POST)
and onSuccess call DrawGraph() method? You can come with something like
below.

$("button").click(function(){
    $.ajax({url: "demo_test.txt",  // Make a post ajax call to your jaggery
api so you can retrieve the params
    success: function(result){
        DrawGraph();
    }});
});

Thanks,
Himasha


On Fri, Jul 10, 2015 at 4:28 PM, Aaquibah Nashry <nas...@wso2.com> wrote:

> Hi Irham,
>
> Now it doesnt disappear. but i dont get the value of the variable im
> retrieving.
> Any suggestions how i can retrieve form elements into jaggery?
>
> Regards,
>
> M.R.Aaquibah Nashry
> *Intern, Engineering**| **WSO2, Inc.*
> Mobile : +94 773946123
> Tel      : +94 112662541
> Email : nas...@wso2.com <nas...@wso2.com>
>
> On Fri, Jul 10, 2015 at 4:09 PM, Irham Iqbal <iq...@wso2.com> wrote:
>
>> Hi Nashry,
>>
>> I think since you have <input type="submit" the form is getting
>> submitted change it to <input type="button" and see whether it's working.
>>
>> Thanks,
>> Iqbal
>>
>> On Fri, Jul 10, 2015 at 4:01 PM, Aaquibah Nashry <nas...@wso2.com> wrote:
>>
>>> well... i used the following code:
>>>
>>> <form id="yearForm" method="POST">
>>>
>>>             <input type="checkbox" name="FullYear" id="FullYear"
>>> value="FullYear" onclick="DisableDropdown()">Display Full year
>>>             <br>
>>>             Enter Year:
>>>             <input type="text" name="Year" id="Year" value="2015"> <tab
>>> align="right">
>>>             Select Quarter:
>>>             <select id="Quarter">
>>>                 <option name="Quarter1">1</option>
>>>                 <option name="Quarter2">2</option>
>>>                 <option name="Quarter3">3</option>
>>>                 <option name="Quarter4">4</option>
>>>             </select> <br>
>>>             <input type="submit" name="button" id="button"
>>> value="Generate Graph" onClick="DrawGraph()"> <br>
>>>         </form>
>>>
>>>
>>> <%
>>>
>>> if(request.getMethod() == "POST"){
>>>  var dyear = request.getParameter("Year");
>>>
>>> if(!dyear){
>>>     response.status = 400;
>>> }
>>> else{
>>>     //query
>>>     response.status = 200
>>>     }
>>> }
>>>
>>> Regards,
>>>
>>> M.R.Aaquibah Nashry
>>> *Intern, Engineering**| **WSO2, Inc.*
>>> Mobile : +94 773946123
>>> Tel      : +94 112662541
>>> Email : nas...@wso2.com <nas...@wso2.com>
>>>
>>> On Fri, Jul 10, 2015 at 3:40 PM, Lakshani Gamage <laksh...@wso2.com>
>>> wrote:
>>>
>>>> Hi Nashry,
>>>>
>>>> How did you send form details to server side? Did you use AJAX or
>>>> something else?
>>>>
>>>> Thanks,
>>>> Lakshani.
>>>>
>>>> On Fri, Jul 10, 2015 at 3:14 PM, Aaquibah Nashry <nas...@wso2.com>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> i am calling a post method in a form. When submitted, a graph should
>>>>> be displayed.
>>>>> When i run the page in a browser, the graph appears and then
>>>>> disappears within seconds.
>>>>>
>>>>> I think after postback the page reloads.
>>>>> How can i overcome this?
>>>>>
>>>>> I am using javascript and jaggery.
>>>>>
>>>>> Thanks in advance
>>>>> Regards,
>>>>>
>>>>> M.R.Aaquibah Nashry
>>>>> *Intern, Engineering**| **WSO2, Inc.*
>>>>> Mobile : +94 773946123
>>>>> Tel      : +94 112662541
>>>>> Email : nas...@wso2.com <nas...@wso2.com>
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> Dev@wso2.org
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Lakshani Gamage
>>>>
>>>> *Software Engineer*
>>>> Mobile : +94 (0) 71 5478184 <%2B94%20%280%29%20773%20451194>
>>>>
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Irham Iqbal
>> Software Engineer - Test Automation
>>  WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>> phone: +94 777888452
>>
>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Himasha Guruge
*Software Engineer*
WS*O2* *Inc.*
Mobile: +94 777459299
himas...@wso2.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to