php - Sending SCROLLTOP javascript via Submit -


i'm trying submit form after updating value of hidden field javascript variable.

this code:

<form name=form1 id=form1 method=get action=gestionale.php> ... ... <input type=hidden name=scrolltop id=scrolltop value=''> <input type=button name=update value=update onclick=vai('form1');> </form>  <script>  function vai(formid) {     document.getelementbyid('scrolltop').value=document.getelementbyid('offerte').scrolltop;     document.getelementbyid(formid).submit(); } </script> 

the form submit works correctly $_get[scrolltop] after form submission, empty if filled javascript. , testing alert before submit shows correct value.

anyone knows why?

thanks lot.

in script...

the line document.getelementbyid('scrolltop').value = document.getelementbyid('offerte').scrolltop;

what intend last bit (('offerte').scrolltop)?

as far understand, want return text value, setting value not return anything.

you need parse query string ($_get variable) , assign variable pass value hidden field.

if i'm being in dark here, i'm sorry. should include bit more of code or additional information if answer seems far fetched.

anyway, hope helps!


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -