Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem remembering things - the computer that is, NOT me =o)

Status
Not open for further replies.

CharlieMike73

Programmer
May 17, 2002
120
US
Hi, I am trying to write some code for a small trouble ticket script I am working on but I am having problems with the forms PHP code.

There are two pages/forms one that initially asks for your details (ticket.php) and a second one (submitted.php) that is ment to check the fields and propmt for the missing fields.

I would also like to move this to one page/form and have it referrence itself and check if it was submitted or diplayed for the first time.

Now here is the problem, but I appear to be having many with it at this time...

If you submit a fully completed form the first time everything is fine and you get the success message , if you miss something then you get the form again with the completed fields filled in for you and the missing ones displayed.

but it never accepts anything I enter on the second try - why?

Also there is a drop down that I want it to remember the option picked from the last screen, it is not doing that either.

There is too much code to post in here, so please download the source code from here:


I hope someone can help, this has been bothering me for some time now.

Thank you,
Charlie
 
I'm not seeing your code, but if you don't get any help till later on, i download it and i look for help you out.

I suppose you poppulate the select from the database:

<select name=&quot;myselect&quot;>
<?
$query=&quot;SELECT id,title from mytable&quot;;
$result=mysql_query($query);
while($array=mysql_fetch_array($result)){
?> <option value=&quot;<?=$array[id]?>&quot; <?=$array[id]==$_POST[myselect]?&quot;SELECTED&quot;:&quot;&quot;?>><?=$array[title]?></option>
<?}?>
</select>

This way you populate the select and remember the first choice of the user after the post.

I don't see the remaining of the code, so i hope someone helps you out, or else i see this later on.
Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Hi,

I think I see what you are saying, but I am not connecting to a database, this is (what I thought to be) a simple form submittion to another page that is ment to display the data.

you can view an --kinda working -- working version here:

you can DL the source code here:

Thank you in advance,
Charlie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top