Hi all,
I’m setting up a signup page to create users for the Mikrotik hotspot service. I have adjusted the HTML in order to remove the profile and payment options, as the profile is always the same, free. I would also like to combine the username and email fields so the user only has to enter the email address to signup, however this doesn’t seem to be passing the variable to the usermanager.
email
<td align="left">
<input type="text" id="sf_email" name="email"
class="signup" value="$(email)" maxlength="100"
autocorrect="off" autocapitalize="off">
</td>
</tr>
What is it I’m doing wrong? I would like to pass the variable from the ‘email’ box to the username when signing up.
Any help would be much appreciated
Ok, so I’ve been told you can’t pass a variable to a hidden input, without using something like Javascript I believe, which is a step in the right direction.
I found some simple Java script did the job. The following line copies the email value to the login value -
document.signup.login.value = document.signup.email.value;
Ideally, after signup I would like the user to automatically be logged in. Is this possible?
Here is a copy of my signup page. It only asks for an email address, the password and profile are forced, and the username is copied from the email address.
User Signup
<p id="logo_title">RouterOS User Manager</p>
</div>
<table class="cntr_tbl">
<tr>
<td align="right">
email
</td>
<td align="left">
<input type="text" id="sf_email" name="email"
class="signup" value="$(email)" maxlength="100"
autocorrect="off" autocapitalize="off">
</td>
</tr>
<input type="hidden" name="password" value="password">
<input type="hidden" name="buy_profile" value="1">
<input type="hidden" name="login">
<tr>
<td colspan="2" align="right">
<input type="submit" name="btn_signup" id="btn_signup" value="Sign up">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<p class="signuperror">$(error)</p>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</td>
</tr>
|
thanks
Hi, were you able to self-login with email?