We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Removing Extra Backslash from Form Submit Button...PLEASE HELP!

Development and Programming

Mike Young's avatar
Mike Young
283 posts
16 years ago
Mike Young's avatar Mike Young

I have a custom module that is essentially a form that takes data from logged in clients and submits it to the site’s database. Since I’ve migrated from one host to another though clients have been unable to use the form. They can enter the data but when the press submit it redirects to the wrong page and the data is not entered in the database.

By using firebug for firefox (which allows you to temporarily change code on the fly for a live site), I was able to figure out that the problem is due to an additional backslash being added to the submit url. Sounds simple enough but I cannot for the life of me figure out how to remove the additional backslash. For example, when I look at the source via firebug, I see this as the submit action:

<form action="http://mysite.com//mytraining/submit/wyN7FfFJWa/" method="post">

If I leave it as is, the form does not submit the data and it redirects the user to the main index page. If I use firebug and change the submit action to

<form action="http://mysite.com/mytraining/submit/wyN7FfFJWa/" method="post">

with only 1 backslash it works perfectly.

The problem is I can’t figure out how to permanently remove the second backslash. In the pertinent template the relevant code says this:

{exp:hpc_client_training:form_details form_hash="{segment_3}"}<h2>{form_title}</h2>{/exp:hpc_client_training:form_details}

{exp:hpc_client_training:submit form_hash="{segment_3}" redirect="/mytraining/report/{segment_3}/"}

I’ve attached the actual module since posting the relevant code exceeded the post length restrictions.

This seems like such a minor problem and I’ve looked around for hours now but haven’t been able to find where that second backslash is coming from as it doesn’t appear anywhere else on the site. If any one can take a look I would REALLY appreciate it.

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
16 years ago
Ingmar Greil's avatar Ingmar Greil

Moved to Modules: Technical Assistance.

       
Mike Young's avatar
Mike Young
283 posts
16 years ago
Mike Young's avatar Mike Young

Anyone have any idea where that extra backslash could be coming from…even if someone could point me WHERE to look that would be helpful as I’ve exhausted all options that I can think of and really need to get this to work. Thanks-

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Have you tried re-coding what you have above to this instead :

{exp:hpc_client_training:form_details form_hash="{segment_3}"}<h2>{form_title}</h2>{/exp:hpc_client_training:form_details}

{exp:hpc_client_training:submit form_hash="{segment_3}" redirect="mytraining/report/{segment_3}/"}

Specifically I took the leading slash away from the second tag.

Don’t know if that will help at all though?

I took a quick look at the file you uploaded to the thread but without having it all set up - database tables and all - just like your site then it would prove quite difficult to tell.

Hope the above code does work for you though.

Best wishes,

Mark

       
Mike Young's avatar
Mike Young
283 posts
16 years ago
Mike Young's avatar Mike Young

Thanks. I had actually tried that since it seemed like the most obvious fix but it didn’t make any difference. Also, I even tried inserting the entire path for the redirect=”http://mysite.com/mytraining/report/{segment_3}/” and it still didn’t work. Like I said…very puzzling.

       
Mike Young's avatar
Mike Young
283 posts
16 years ago
Mike Young's avatar Mike Young

If I use firebug to remove the second backslash the form works perfectly and it actually redirects to

http://mysite.com/mytraining/report/{segment_3}/

Unfortunately firebug won’t actually edit the file permanently and I still can’t figure out where the 2nd backslash is coming from. If anyone can figure this one out I’d really appreciate it. At this point, I’m willing to pay because I need to get this fixed. Let me know if you’re interested.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.