iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old March 12th, 2008, 08:24 PM   #1
New Member
 

Join Date: Dec 2007
Location: auckland
Age: 34
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 sudhakararaog is on a distinguished road
relative linking in php

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.
sudhakararaog is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old March 12th, 2008, 08:43 PM   #2
Most Reputable Member
 

Join Date: Feb 2008
Location: In My Own Little World
Age: 15
Posts: 1,346
Blog Entries: 9
Thanks: 2
Thanked 45 Times in 45 Posts
Rep Altering Power: 0 CloudedVision is on a distinguished road
Re: relative linking in php

You would want to use a mix of javascript and PHP.

Code:
<?php if(!$validate) { ?>
<script type="text/javascript">
<!--

window.location = window.location + "#<?php echo $invalid_div; ?>";

//-->
</script>
<?php } ?>
Please note I'm not sure this will work, I've never done this sort of thing with javascript before.
__________________
Theron Luhn
CloudedVision is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
positioning - relative or absolute? google HTML, XHTML and CSS 13 November 8th, 2007 12:00 PM
Is it possible to position something relative something else? the newbie web designer HTML, XHTML and CSS 7 February 22nd, 2007 02:04 PM
relative position problem antonyx HTML, XHTML and CSS 12 December 30th, 2005 05:19 PM
can layers be relative? warmer HTML, XHTML and CSS 0 November 8th, 2005 02:42 PM
Relative linking to Access... JohnMitch Classic ASP 6 August 10th, 2005 10:19 AM


Search Engine Optimization by vBSEO 3.2.0 RC8