Re: relative linking in php
| From: | Nitsan Bin-Nun | Date: | Sat, 22 Mar 2008 08:18:06 +0000 |
| Subject: | Re: relative linking in php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-271963@lists.php.net to get a copy of this message | ||
Oops, I didnt post it to the list, copy is attached.
On 22/03/2008, Nitsan Bin-Nun <nitsanbn@gmail.com> wrote:
>
> Hi Sudhakar,
> There are 2 solutions,
> You can change the <form> tag to something like:
>
>
> > <form action="<?php echo $_SERVER["PHP_SELF"];
> > ?>*#errorsArea*"
> > method="POST" id="test2"
> > name="registrationform">
>
>
> Then add the following line before the errors:
>
>
> > <a name="errorsArea"></a>
>
>
> The main problem here is that in case there are no errors it still go
> down.
> If you dont want to get down when there are no errors, you can send it
> without the #errorsArea call, and in your php, check the errors, if there
> are errors you can forward to #errosArea otherwise dont forward.
>
> HTH
> Nitsan
>
> BTW
> Personally, I would avoid those things and use AJAX instead.
>
> On 22/03/2008, Sudhakar <sudhakararaog@gmail.com> wrote:
> >
> > i am using a self submitting for using php
> > <form action="<?php echo $_SERVER["PHP_SELF"]; ?>"
> > method="POST"
> > id="test2"
> > name="registrationform"> the registration page starts with a lot of
> > terms
> > and other details about the registration and then the form fields for
> > the
> > user to fill the registration page. i have used php to validate the
> > form,
> > presently when a user clicks the submit button and if there are any
> > validateions that need to be displayed to the user, then the user has to
> > scroll from the top of the page all the way till they see the form
> > elements
> > with the validation message ex= Please enter your phone number.
> >
> > my question is, as in html with relative linking ex <a href="#link1">
> > click
> > here</a>
> > <a name="link1"> </a>
> > Text here
> >
> > the page can be moved to an exact location, can this be done more or
> > less
> > close to this relative linking using php so that the user need not
> > scroll
> > from the top of the page to see the validation message.
> >
> > NOTE = since i am using a self submitting form just before the first
> > form
> > element i have created a blank table row and in this table row the php
> > validation message would appear if the user missed out some information.
> > due
> > to this the user has to scroll from the top of the page to see the php
> > generated validation message. if i use the same php validation at the
> > very
> > top of the page the error message will be at the top and the form fields
> > at
> > the bottom and the user will have to scroll up and down to read the
> > validation message.
> >
> > please advice.
> >
> > thanks.
> >
>
>