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?
xuexue
15
Junior Poster
Recommended Answers
Jump to Postdepending 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
qazplm114477
14
Junior Poster
xuexue
15
Junior Poster
lyrico
23
Junior Poster in Training
happytogether
6
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.