phpfan101 Posted December 9, 2009 Share Posted December 9, 2009 so, i have started my first php project, a fully featured Forum. I ran into trouble, and have been stumped for almost a week, I'm using php/mysql. so I made the post category form. made sure it works. I even have all of the fields set to be validated in php. But, i don't want that because I would prefer to just send a js alert when a user hits submit, so the page never changes, and they can just hit "ok" on the alert and edit the info, not so it changes pages and the user has to retype everything :-\ <form method='post'> <table width='100%'> <tr> <td width='25%'>Name:</td> <td width='25%'> <input type='text' name='name' id='name' size='40' maxlength='15'> </td> </tr> <tr> <td width='25%'>Description:</td> <td width='25%'> <textarea name='desc' cols='60' rows='4' ></textarea> </td> </tr> <tr> <td width='25%'>access:</td> <td width='25%'> <textarea name='access' size='5' maxlength='2'></textarea> </td> </tr> <tr> <td width='25%'></td> <td width='25%'> <input type='submit' name='submitcategory' value='Submit Category'> </td> </tr> </table> </form> So there's the form itself, any help is appreciated!!! Link to comment https://forums.phpfreaks.com/topic/184481-form-validation/ Share on other sites More sharing options...
Bane Posted December 9, 2009 Share Posted December 9, 2009 I think you are trying to make your form fields "sticky", you should do something like: <input type='text' name='name' id='name' size='40' maxlength='15' value="<?php echo $name; ?>" /> where $name is shortname for $_POST['name'] hope this helps. Link to comment https://forums.phpfreaks.com/topic/184481-form-validation/#findComment-973868 Share on other sites More sharing options...
phpfan101 Posted December 9, 2009 Author Share Posted December 9, 2009 ok, so if a value is posted, and any are false, they will be there when the person has to edit, yes, that is different, but works for my situation thanks bane!!! Link to comment https://forums.phpfreaks.com/topic/184481-form-validation/#findComment-973869 Share on other sites More sharing options...
Bane Posted December 9, 2009 Share Posted December 9, 2009 glad if I can help Link to comment https://forums.phpfreaks.com/topic/184481-form-validation/#findComment-973875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.