close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Redirect after error

Thread began 10/31/2009 1:42 am by mick106153 | Last modified 11/05/2009 8:11 pm by Eric Mittman | 1784 views | 7 replies |

mick106153

Redirect after error

I have a HUGE page with a form at line 2741.
After implementing Contact Form Solution Pack the normal result of an error is to be taken back to the same page.
Which in my case is a problem because all the links on the page reveal or hide normally hidden divs.
My form is in one of those divs and I don't have a clue how to get the redirect to take me back to the form - again normally hidden around line 2741.

Mick

Sign in to reply to this post

Eric Mittman

Do you have a link where this issue can be seen at all? I'm not really sure what the nature of the problem is and could use some more description or a visual reference for the issue. Please post back with as much info as you can so that we can have a better understanding of what the problem is that you are experiencing.

Sign in to reply to this post

mick106153

Well I was hoping to avoid showing the world my dirty laundry - but what the heck.
Link to page in transition.

indexoldform.php

Form occurs at line 2741.
I've tried numerous methods to get back to the form after a failed validation. Currently, it's linked to an anchor which I didn't think would work - and it doesn't.
The primary link to the form
<li><a href="javascript:;" id="p7TBMt07" onclick="P7_TBMtrig(this);P7_ABopen('1_12');P7_ABopen('2_7');return false">Contact Us</a><br />
occurs at about line 385

My intention is to break this page up at which time the form would be independent of the page. At the moment though, let's call it an experiment in "how to".

Sign in to reply to this post

Eric Mittman

Thanks for the link and the js code for it, this is very helpful.

I think that you will need to activate the same js as when you click on this link in order for the form to show up again. One way you could do that would be to call this js in the body onload event. This should cause this form to appear on the page when the page loads.

To make this only happen when the validations fail you could add a php if statement around the body onload event like this:

php:
<body <?php if(isset($_POST['invalid']) && $_POST['invalid'] == 'true') echo "onload=\"the js code here\"" ?> >



This should get that part of the page to load so long as the js code works correctly. Make sure you get that part working before you attempt to add in the php code.

Sign in to reply to this post

mick106153

Thanks Eric
Hope is I will break the page up before I need to do this but regarding the "onload=" am I to understand that the backslashes and quotes should be placed as you've defined them or is it just quote quote? I am new to this and will be for some time.

Mick

Originally Said By: Eric Mittman
  Thanks for the link and the js code for it, this is very helpful.

To make this only happen when the validations fail you could add a php if statement around the body onload event like this:

php:
<body <?php if(isset($_POST['invalid']) && $_POST['invalid'] == 'true') echo "onload=\"the js code here\"" ?> >


This should get that part of the page to load so long as the js code works correctly. Make sure you get that part working before you attempt to add in the php code.  
Sign in to reply to this post

Eric Mittman

The reason I have the slashes in front of the double quotes like this is so they are properly escaped within PHP. This is because php uses these double quoted to indicate the start and stop of a string literal. If you want a double quote to be printed from within a string literal you must escape them with the slash or it would just signify the end of the string and whatever comes after the quotes will not be printed. You will also likely get an error message for whatever occurs after that.

Here is a link to the php page on the topic of strings:

language.types.string.php

Sign in to reply to this post

mick106153

Ah Yes. Should have remembered from PHP 101;-)

Thanks Eric

Mick

Sign in to reply to this post

Eric Mittman

Your very welcome, have you got this part worked out yet, I'm curious about the result.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...