Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

index.php

Questions related to using nuBuilder Forte.
Post Reply
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

index.php

Unread post by Timo »

If the Enter key is pressed on the login page (index.php), nothing happens. Most login forms would submit the form.
And Chrome shows a hint. It's nothing critical but shouldn't appear:
[DOM] Password field is not contained in a form: (More info: https://goo.gl/9p2vKq) <input id=​"nupassword" style=​"position:​ absolute;​ top:​ 200px;​ left:​ 100px;​ background-image:​ url("data:​image/​png;​base64,xxxxx")​;​" type=​"password" autocomplete=​"off">​
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: index.php

Unread post by admin »

Timo,

Did you know you can create your own index page by adding a variable in nuconfig.php called $nuWelcomeBodyInnerHTML that contains your HTML...

Code: Select all

    $nuWelcomeBodyInnerHTML			= " 
	

				<div id='login' class='nuLogin' style='background-color:#d8e4ff; width:330;position:absolute;top:50px;height:300px;left:50px;border-style:solid;border-width:1px;border-color: rgba(0, 0, 0, 0.08);'>
					<div id='nulogo' style='background-size:100% 100%;background-image:url(\"graphics/logo.png\");position:absolute;width:200px;height:80px;top:45px;left:65px;'></div>
					<br>
						<div style='position:absolute;top:170px;left:20px;text-align:right;width:70px;display:inline-block;'>Username</div>
						<input id='nuusername' style='position:absolute;top:170px;left:100px;'/>
					<br>
					<br>
						<div style='position:absolute;top:200px;left:20px;text-align:right;width:70px;display:inline-block;'>Password</div>
						<input id='nupassword' style='position:absolute;top:200px;left:100px;' type='password'/>
					<br>
					<br>
						<input id='submit' type='submit' class='nuButton' style='position:absolute;width:90px;height:30px;top:240px;left:130px;' onclick='nuLoginRequest()' value='Log in'/>
					<br>
					<br>
				</div>

									";
If someone wants to make a better one I might "steal" theirs.


Steven
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: index.php

Unread post by Timo »

I wrapped it in form tags. If you think it's useful, you're welcome to use it.

Code: Select all

    $nuWelcomeBodyInnerHTML			= " 
	<form id=\"nuLoginForm\" action=\"#\" method=\"post\" onsubmit=\"return false;\">
	<div id='login' class='nuLogin' style='background-color:#d8e4ff; width:330;position:absolute;top:50px;height:300px;left:50px;border-style:solid;border-width:1px;border-color: rgba(0, 0, 0, 0.08);'>
	   <div id='nulogo' style='background-size:100% 100%;background-image:url(\"graphics/logo.png\");position:absolute;width:200px;height:80px;top:45px;left:65px;'></div>
	   <br>
		  <div style='position:absolute;top:170px;left:20px;text-align:right;width:70px;display:inline-block;'>Username</div>
		  <input id='nuusername' style='position:absolute;top:170px;left:100px;'/>
	   <br>
	   <br>
		  <div style='position:absolute;top:200px;left:20px;text-align:right;width:70px;display:inline-block;'>Password</div>
		  <input id='nupassword' style='position:absolute;top:200px;left:100px;' type='password'/>
	   <br>
	   <br>
		  <input id='submit' type='submit' class='nuButton' style='position:absolute;width:90px;height:30px;top:240px;left:130px;' onclick='nuLoginRequest()' value='Log in'/>
	   <br>
	   <br>
	</div>
	</form>";
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: index.php

Unread post by admin »

Timo,

I have "stolen" that now and it's in the latest Github changes as the default - not using $nuWelcomeBodyInnerHTML in nuconfig.php.

Steven
xyz2019
Posts: 11
Joined: Wed Jan 30, 2019 2:20 am

Re: index.php

Unread post by xyz2019 »

admin wrote:Timo,

I have "stolen" that now and it's in the latest Github changes as the default - not using $nuWelcomeBodyInnerHTML in nuconfig.php.

Steven
Curious to know which file contains the default code of $nuWelcomeBodyInnerHTML?
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 446 times
Contact:

Re: index.php

Unread post by kev1n »

Just modify the one in nuconfig.php.
Post Reply