hi guys, this is the scenario, i have two textboxes, then a submit button.
now, when the user clicks the submit button, it will verify if both textboxes have values,
otherwise, if only one of them is empty, an alert box will be displayed prompting the user to complete the information. this scenario is perfect and is working out fine. now, what i want to happen is that, the alert box will be displayed then the value inputted by the user on the textboxes will not be erased. how is that so?
Jump to Post
depending on the method you use the submit the (if it's post or get) you can do something like this
<form action='index.php' method = 'post'> <input type = 'text' name = 'text1' value = '<?php echo ( isset( $_POST['text1'] ) ? $_POST['text1'] : '' ) ?>' /> …
All 4 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.