Forum Moderators: open

Message Too Old, No Replies

php function to javascript function then callback

stepping stone

         

nanat

1:45 am on Jan 21, 2010 (gmt 0)

10+ Year Member



This are my code in sequence in php

on click
<a href="index.php?option=uploadForm">Upload Files</a>

Passing through


case 'uploadForm':
$subCoreHTML = uploadME(1);
break;

Function uploadME() stepping stone


function uploadME($steps)
{
if($steps ==1)
{
//statement
<input type="submit" name="submit" onClick="process(2,\'ok\');" value="Submit">
}
else if($steps ==2)
{
<input type="submit" name="submit" onClick="process(3,\'ok\');" value="Submit">
}
}

javascript:

function process(step,act)
{
if(step == 2)
{
//code
}
else if step(step == 3)
{
//code
}

}

my question is how can i pass the value step in JavaScript in order for me to get and pass the value to uploadME($steps) in php?..

nanat

9:45 am on Feb 3, 2010 (gmt 0)

10+ Year Member



i got it

function process(step, act)
{

if (step == 2)
{
$(document).ready(function(){
$.get('index.php',{option:'uploadForm', page: '2'},function(data)
{
$('body').html(data);

});
});

}
}