Ruby on Rails

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentRuby on Rails

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old June 19th, 2007, 03:41 PM
clem_c_rock clem_c_rock is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 33 clem_c_rock New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 3 h 33 m 46 sec
Reputation Power: 0
Javascript_tag replacing whitespaces w/ '%20'

Hello,

I have a form that tests if a title has been changed since the page was loaded and the page has been submitted. If the page title has been changed then a confirm box will ask if the user wants to have the title changed. The problem is if the person hits cancel, all white spaces in the title get replaced w/ '%20'.

Here's the code I was using:

Code:
<%=javascript_tag( "function confirmSubmit(){ var page_title_before= '#{u @page.title}';
                                              var page_title_on_submit = escape($('page_title').value);
	                                          if( page_title_before != page_title_on_submit ){ 
	                                              var agree=confirm('Changing the title of this page will break any links or bookmarks that refer to it.\\nPress \"OK\" to save with the new title, or \"Cancel\" to revert to the original title.');   
                                                 if(agree){ return true; }
												 else{  alert( 'page_title_before-->>' + escape(page_title_before) ); $('page_title').value = page_title_before; return false; }
	                                          }
                                              else{ return true; }}") %>

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentRuby on Rails > Javascript_tag replacing whitespaces w/ '%20'


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap