cooldude Posted June 2, 2007 Share Posted June 2, 2007 I have the following code <table> <form action="details.php?id='$id" onSubmit="win=window.open('','test','toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=560,height=600,left = 80,top = 40'); this.target='test';"> <tr><td>ID :</td><td><input type="text" id="id" name="id" value="" maxlength="20"></td></tr> <td><input type="submit" name="submit" value="submit"></td> </form> </table> I would like to validate the ID when submit button is clicked and display an error message on the screen if it is invalid. If it is valid then I want the details of ID to popup. Any help would be greatly appreciated!! Thanks in advance Quote Link to comment Share on other sites More sharing options...
taith Posted June 2, 2007 Share Posted June 2, 2007 on the popup... do your query, if it finds the id... show it, else, error... showing on the page would require refreshing the page, making the popup pointless... Quote Link to comment Share on other sites More sharing options...
chocopi Posted June 2, 2007 Share Posted June 2, 2007 Also, quite a number of peoples computers block pop-ups with the virus things etc Quote Link to comment Share on other sites More sharing options...
cooldude Posted June 2, 2007 Author Share Posted June 2, 2007 Thanks! But I don't want to do the popup if the ID is invalid.. Just want to display the error message on the screen.. How can that be achieved??? Quote Link to comment Share on other sites More sharing options...
chocopi Posted June 2, 2007 Share Posted June 2, 2007 well just run with the check before you use the popup if // id is invalid { echo "Invalid"; } else { // popup script } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.