I have a textfield that takes a user's name but i dont want to save the
user's name in a database table i just wanna be able to display it in all
the pages as long as the user is going through the web pages they should
see their name with the welcome message but what i have achieved so far is
to only display it in one page, the first page where they entered their
name, the other pages dont display anything, here is my code:
*CONTROLLER*
def echo():
return 'Welcome, ', request.vars.name
*VIEW 1*
<div id="target" class="target" style="float: right; color: #1f8f7b;
font-weight: bold;">
</div>
<div id="emc-score"></div>
<div id="greetings" class="greetings">
Hello, welcome to <b>T.K's</b> computurised driving theory testing
system, please enter your name in the <code>textfield</code> below and
click begin to start, GOODLUCK<br />
<form id="enterName">
<input type="text" name="name" placeholder="Enter your name" /> <a href=
"#" id="greet" onclick="ajax('{{=URL('default', 'echo')}}', ['name'],
'target')" ><img src="{{=URL('static/images', 'start.jpg')}}" width="60px"
/></a>
</form>
</div>
How do I get view 2 & the rest to also display the user's name after
collecting it the first time when they get started?
*VIEW 2*
<div id="target" class="target" style="float: right; color: #1f8f7b;
font-weight: bold;">
</div>
<div id="emc-score"></div>
<div class="wrap">
<div class="row">
<section data-quiz-item>
QUESTION 1
<div class="question">What Influences the degree of centrifugal force
on bends?</div>
<div class="choices" data-choices='["The radius of the bend",
"Speed","The height of your vehicle"]'>
</div>
</section>
Mostwanted
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.