scriptham Posted December 26, 2007 Share Posted December 26, 2007 Hi Would you mind helping with a formprocessing question please. Is it possible to post data back to a form after a server side calculation? I have used the java script document.strength.M1.value = M1 To build a prototype but now in php I don't have this sort of thing available. (It posts the value for M1 into the M1 cell in the strength form). If it can't be done then I will find another way. Having processed the submitted data I would probably need to read the contents of variables into a replacement form or even a similar table design and have the page refresh. Perhaps I could ask the supplementary question, is all this possible on user pressing submit? I'm afraid I'm a bit of a newbie, sorry. Many thanks ScriptHam Quote Link to comment https://forums.phpfreaks.com/topic/83274-solved-post-data-to-php-then-post-back-to-cell-in-form/ Share on other sites More sharing options...
drummer101 Posted December 26, 2007 Share Posted December 26, 2007 As long as the form exists on the page after your press submit. <? $text = $_POST['formdata']; echo "<textarea>$text</textarea>"; echo "<input type=\"text\" name=\"info\" value=\"$text\">"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/83274-solved-post-data-to-php-then-post-back-to-cell-in-form/#findComment-423633 Share on other sites More sharing options...
Daleeburg Posted December 26, 2007 Share Posted December 26, 2007 More or less it is the same as if you put a value automatically in HTML, except the value is a variable. Just a for warning, This gets horribly complicated when you get radio buttons, you need an IF statement for each button. ~D Quote Link to comment https://forums.phpfreaks.com/topic/83274-solved-post-data-to-php-then-post-back-to-cell-in-form/#findComment-423652 Share on other sites More sharing options...
scriptham Posted December 26, 2007 Author Share Posted December 26, 2007 Hi Thanks Daleeburg and thanks Drummer. Its certainly worth having the warning about the radio btns. Brilliant solution - it works like a charm on numbers, which right now are my greatest concern. Many thanks and a very merry Christmas. Scriptham Quote Link to comment https://forums.phpfreaks.com/topic/83274-solved-post-data-to-php-then-post-back-to-cell-in-form/#findComment-423741 Share on other sites More sharing options...
drummer101 Posted December 26, 2007 Share Posted December 26, 2007 No problem, merry christmas to you too Quote Link to comment https://forums.phpfreaks.com/topic/83274-solved-post-data-to-php-then-post-back-to-cell-in-form/#findComment-423760 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.