0

I'm using JQuery SmartWizard and it has the ability to load content using Ajax, but I do not see how to pass any parameters to the server. Am I missing something?

It seems like the purpose of having Ajax is to send parameters to the server, and get back different content depending on input parameters, right? I only see a step_number parameter, but I don't know how or if that can be altered, since there are a static number of steps. Thanks.

Dipu Raj
  • 1,784
  • 4
  • 29
  • 37
Dave
  • 4,949
  • 6
  • 50
  • 73

2 Answers2

1

you pass variables to the server using the url. file.php?do=nothing&name=john&relaxmode=on

function getdata(url,id,lastseen)
    {
    $.ajax(url+’?userid=’+id+’&lastvisit=’+lastseen).done(function(data)
        {
        if(data.indexOf(’alive’)!=-1)alert(’he is alive’)
        })
   }
Tschallacka
  • 27,901
  • 14
  • 88
  • 133
  • I tried that, but maybe my problem is that I do not know how to change the URL once it is set. When I reissue a URL with a new querystring, it seems to reset the whole control. Can you give me an example on how to change it in a Javascript function? – Dave May 25 '12 at 22:52
  • The SmartWizard object contains the definition for the ajax url, but does not seem to be holding any changes I make to the url using that technique. It is defined when the object is created. I tried changing it in the validation step and the stepStart function, but it still retains the original url definition. I'm trying to figure this out without having to make changes to the smartwizrd code. – Dave May 29 '12 at 15:13
  • Oh, sorry I failed to realize that the variable could just be passed to the session on the server, and that it did not need to be built into the SmartWizard object. Thanks. – Dave May 29 '12 at 16:45
1

You can make change to ajaxurl in function leaveAStepCallback. you can place one hiddenfield and can assign modified ajaxurl in this hidden field. in wizard js file we should modify that url call to get value from hidden field value of ajaxurl.

i.e before ajax call

if ($("#ajaxUrl").val() != "") {
                               ajaxurl = $("#ajaxUrl").val()
                           }
valli
  • 11
  • 1