<form action='<?php echo $_SERVER['PHP_Self']; ?>'>
<input type='text' name='field1' value='<?php if(isset($field1)){echo $field1; } ?>'>
<input type='text' name='field2' value='<?php if(isset($field2)){echo $field2; } ?>'>
<input type='text' name='field3' value='<?php if(isset($field3)){echo $field3; } ?>'>
<input type='text' name='field4' value='<?php if(isset($field4)){echo $field4; } ?>'>
<input type='submit' onclick="return confirm('Are all fields complete?')">
I like to add confirmation to the submit button, degrades ok with javascript disabled,
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
Logial Correction, and statement of the obvious :icon_confused:
<?php
/*
logical construct depends on your data,,,
validate data entries,
if valid
insert to mysql,
disable submit so data will not be aded to table twice,
or redirect to another page
else
echo feedback to user to explain what is right/wrong with the submitted data before the form is resubmitted
*/ ?>
<form action='<?php iecho $_SERVER['PHP_Self']; ?>'>
<input type='text' name='field1' value='<?php if(isset($field1)){echo $field1; } ?>'>
<input type='text' name='field2' value='<?php if(isset($field2)){echo $field2; } ?>'>
<input type='text' name='field3' value='<?php if(isset($field3)){echo $field3; } ?>'>
<input type='text' name='field4' value='<?php if(isset($field4)){echo $field4; } ?>'>
<input type='submit' onclick="return confirm('Are all fields complete?')">
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376