1

Basically i have a textbox on my .html page

<input name="points" type="text" id="points" value=""/>

and in the .js that gets called just onsubmit

document.getElementById('points').value = creator.showData();

i actually see with my eyes that the text is being added to the textbox however the php isn't reading the $_POST however if i manually enter the text into the same text box it works.

Any Ideas ? been screwing with my head all morning XD

2
  • Maybe showData is adding blank spaces thus although it look numeric it isn't? Commented Apr 27, 2011 at 11:14
  • the same thing happen with me, but i was using java Commented Apr 27, 2011 at 11:15

1 Answer 1

0

It probably submits the form before the value is set.

Try this...

(function() {    
    var submitted = false;
    form.onsubmit = function(event) {
        if (submitted) {
            return true;
        }
        event.preventDefault();
        document.getElementById('points').value = creator.showData();
        submitted = true;
        form.submit();
    }
})();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.