Hi, im having trouble doing something that should be simple..
i have a form that inputs some data into a table using php and jquery.. after that input i have to reload the page so that is possible to see the new data on the table. So i added some echos into my form inputs like this:
if (array_key_exists('_submit_check', $_POST)) {
$nplaca = $_POST["nplaca"];
}
<input name="nplaca" id="nplaca" type="text" class="input" value="<?php echo $nplaca ?>" >
it worked fine until i had to do something that would change everything..
before i was using the jquery post function like this (i removed most of the values to simplify).
$.post("adicionar.php",{n_placa:nplaca.value});
location.reload(true);
and it worked fine, after the reload all the form values were still there.
but now my jquery post is like this
$.post("adicionar.php",{n_placa:nplaca.value},function(data){
if(data>=1)
alert('X');
else
alert('Y');
location.reload(true);});
return false;
but all my form values are gone after the reload, and if i try to put it out like before, the data value is not passed (have no idea why), also the "return false" is required for it to work (why?).
i tried to put oFormObject.elements["nplaca"].value = nplaca.value; after the reload but doesnt work.
hope you guys can understand...
thanks!!!