Another issue i am facing with redirecting is here, i am using ajax to take
the registration key from the user to a controller, what is supposed to
happen is that if the registration key is valid the user should be
redirected to another page allowing them normal application usage. The
directing not cant redirect to a new page instead it opens the page
redirected to in the div where it should display the *Incorrect Code *. How
can i manipulate this to be able to redirect to an enirely new page if the
Registration Key is correct & still be able to display the *Incorrect Code
*message
in the relevant div?
*VIEW CODE*
<div id="code">
<input id="regcode" maxlength="10" type="text" class="field" name=
"regCode" autocomplete="off" onkeyup="ajax('product_key_entry', ['regCode'],
*'regCodeTarget'*)" placeholder="Enter Product Key"/><br />
<div id="regCodeTarget"></div>
*'regCodeTarget' *is where the page keeps getting displayed
*CONTROLLER CODE*
*def reg_key_entry(): key_exists = not db(db.regKeys.regKey ==
request.vars.regCode).isempty() if key_exists: #A used reg key
should get deleted so that it cant be used twice
db(db.regKeys.regKey == request.vars.regCode).delete()
redirect(URL('index')) else: return DIV("INCORRECT PRODUCT KEY",
_id="regCodeTarget", _style="color: white; border: solid 1px red; width:
160px; background-color: red; font-weight: bold; padding: 3px;
border-radius:5px;")*There must be something I can do which i dont know,
please help!
Regards;
Mostwanted
On Monday, August 19, 2019 at 12:16:55 PM UTC+2, Val K wrote:
>
> There is no 'select' in your code. Is that a typo?
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/5f54abf9-448a-4f65-8f2d-23cee7c53035%40googlegroups.com.