[Pro] annoying little problem may be hard to fix

Dave… look at the end of Walt wrote when we put together the thing that makes their name appear at the end. SOmehting about if they do not type their name…

I think this is it. It is senfing them to another page but emailing me. It never did this…

From Walt

Very easy. Let’s do it in JavaScript first, since that won’t require any changes to the rest of your site. First lesson of cookies — you can only read them on the NEXT page, not the current page. So if you set a variable in a cookie on one page, you can read it on the next, but not the current page.

Apply Protaculous 2 to the page, if you haven’t already. In the Additional JavaScript Libraries section, enter ‘cookiejar’ (without the quotes) in the name field, and ‘http://cdn.freewaypro.com/cookiejar/1.5.1/cookiejar.js’ (without the quotes) in the CDN URI field.

Click on the DOM Loaded Observer button, and enter this code: cookie-name.js · GitHub

Draw an HTML box where you want the name form to appear, and insert a text field and a button in it. Name the text field ‘name’, using the Name/ID field of the Inspector, and confirm in the third tab that the Name attribute is properly set to ‘name’.

Name the button ‘send’, using the same degree of care. Set the Value of the send button to whatever you like. (Optional: if you want the setting of the name to automatically navigate the user to the next page, then in the Page / Form Setup, set the Action to the actual filename of the second page, and the Method to GET.)

On the second page, draw an HTML box where you want the name to appear, and type out a placeholder name. Using the Inspector, change the name of this HTML box to nameDisplay. When styling the name in the placeholder, make sure that you use a Paragraph style, not an inline (Inspector-made) style. Select the name, and make sure that the style that is highlighted in the Styles palette has a pilcrow (¶) before its name.

On that same page, apply the Protaculous 2 Action, also include the link to the cookiejar script, and in the DOM Loaded Observer, type the following:

What this will do is redirect the user back to the index.html page if they haven’t entered their name (assuming of course that index.html is where that happens) so adjust that URL if it’s not correct.


freewaytalk mailing list
email@hidden
Update your subscriptions at: