Jump to content


Photo

Jump to anchor after form validation


  • Please log in to reply
1 reply to this topic

#1 gingerbraid

gingerbraid
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 16 May 2006 - 05:07 PM

Hi, I would really appreciate your help on this. I've seen a similar post here, but I still couldn't figure my problem out. I have a page with two nested forms; the inner has a text input field where the user enters an ID and then clicks on a "Preview" button to upload information for that ID from the database onto another section of the form. This upload must take place before hitting "Save" to submit the main form.

I have a [rather complex] validation code on form submission. If the validation fails, I want to reload the page at a specific anchor. Problem is, the form jumps to the anchor only when Save is clicked twice. I understand that some kind of refresh needs to be done.

Does anyone know how to implement that refresh offhand, or do you need code to illustrate?

TIA.

#2 gingerbraid

gingerbraid
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 17 May 2006 - 09:24 PM

Anybody???

Clarification: What I'm doing is SERVER-SIDE validation code, and I want to reload the form on the client-side at a specific anchor if the validation was unsuccessful.

I have partially figured it out: The anchor doesn't work because the form is inside a function in a different class; the main class (which $_SERVER{"PHP_SELF"] refers to) performs validation and then calls a function in another class, which prints the form. Thus, the anchor is not found and, therefore, not redirected. Can anyone suggest a workaround?

Much appreciated.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users