You are here: -> How to read a form variable before posting? <- « PHP Programming Language « IT news, forums, messages
-> How to read a form variable before posting? <-

Posted by Steve JORDI on 05/14/07 13:27

Hi,
is there a way to read the content of a form variable before
a POST?

I have a form with a "duplicate" button which opens a new form
with most of the fields filled with the values of the calling one.
To do so, I pass the id of the form to be duplicated.
Example:
- I have a form with "Number = 1234567" in a "numform" edit field.
- Duplicate has a href=/duplicateform.php?id=1234567
- then the "duplicateform.php" reads id with a GET['id']

This is easy as I come from a displayed form that retrieves its
values via a SQL statement and with a specific "number" reference.

Now, once I am in this new form, I have a save button to save all
values, including the new "Number" the user would type in, say
"22222222". The save process works correctly via AJAX and saves the
record using a POST action.
But then, I still have my "duplicate" button which should now
point to href=/duplicateform.php?id=22222222
How can I get this 22222222 value from within the form itself?
I have to get it from the "numform" field, but how can I do this?

it would be something like
href=/duplicateform.php?id=<?=[value_of_field_number]?>

with value_of_field_number being the actual value of that edit field.

Any help would be appreciated.



Sincerely,
Steve JORDI

(Remove the K_I_L_LSPAM from my email address)
------------------------------------------------
1197 Prangins Email: stevejordiK_I_L_LSPAM@hotmail.com
Switzerland WWW: www.sjordi.com
------------------------------------------------
Volcanoes at www.sjordi.com/volcanoes
MovieDB at www.sjmoviedb.com
------------------------------------------------

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация