Not quite sure if this is the place to post this- but here it goes.
I am creating an error page in html that will also contain a php script.
Part of the script is to post the error message using echo().
The problem is that I want to have that error message not open up in a huge web page when it only contains a few lines of instruction. So do I set this parameter in the html code (body size etc..) or is this better set php or some other way. I would like to have it open in a window say- 300Width X 300Length. I am very new to this code stuff but am having a great time learning it. Here is my code if needed.
Quote:
if(strlen($name) == 0) {echo ("Please enter a name in the field provided- Thank you.");exit;}
I hope this is enough info. Thanks again. I am really enjoying this forum.
Ok- That worked but............... I wanted it to open in a new browser window so that after reading the error message- they could "X" out of it and return to the form and correct their problem.
As it is- it opens in a small window like I wanted --but there is no way to get back to the form in a regluar size window. Any suggestions?
If you want to post your data in a page which will open in a new window then use target="_blank" in your <form> tag. Then resize the window using resizeTo(300, 300).
Greetz
Our resident Javascript Guru should be able to help.
We have one of those? Strange, I don't remember seeing him around here...
Anyways, if you want to keep things simple, do like bd_coder suggested and put the target="_blank" attribute in the <form> tag. That will open the validation/submission page in a new window.
Then you need to make sure that the script
is placed in the <head> tag on that page (which, judging by your last post, seems to be working already).
You might also want to add some code to disable the submit button after it has been pressed to avoid double posts. And maybe re-enable it from the popup if the validation fails so it can be resubmitted.