You are viewing our Forum Archives. To view or take place in current topics click here.
[Help] Is this possible with HTML?
Posted:

[Help] Is this possible with HTML?Posted:

Pinguicula
  • Resident Elite
Status: Offline
Joined: Apr 27, 201113Year Member
Posts: 250
Reputation Power: 9
Status: Offline
Joined: Apr 27, 201113Year Member
Posts: 250
Reputation Power: 9
I've recently started to learn HTML and I wanted to make a "survey" type project that would ask for your password and you would just answer the question it asks. I've gotten as far as making the password, buttons, and general text. What I'm wondering is if it's possible to have a window pop up for when either they don't use a password and try to submit the form and have the window say "Please enter a password", or if they select the wrong answer and window says "wrong" or say it's "correct". I've been to multiple forums and online tuts but they all just spoon feed you the code and that's not what I'm looking for. I mostly want to know if this is even possible and if someone could "lead" me to the right direction for the proper code and not just tell me to copy and paste it.

(I'm using Eclipse as my editor)
My work so far.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>My Website</title>
</head>
<body>
<div align="center">
Please enter your password before filling out the form.
<br> <input type="password" size="10" style="height: 29px; width: 238px; "><form>
<input type="submit" value="Login">
</form>
What weapon is this?
<br>
<input type="image" src="C:\Users\%username%\Pictures\myweapon3.jpg" name="image" width="60" height="60" style="height: 96px; width: 359px; "><form>
<input type="checkbox" value="M24" name="M24">M24
<br>
<input type="checkbox" name=".50 Cal" value=".50 Cal">.50 Cal
<br>
<input type="checkbox" value="M40a3" name="M40a3">M40a3
<br>
</form>

</body>
</html>
#2. Posted:
Lic
  • TTG Senior
Status: Offline
Joined: Dec 09, 201112Year Member
Posts: 1,939
Reputation Power: 83
Status: Offline
Joined: Dec 09, 201112Year Member
Posts: 1,939
Reputation Power: 83
[ Register or Signin to view external links. ]

and i found one error just looking scanning it

<input type="image" src="C:\Users\%username%\Pictures\myweapon3.jpg" name="image" width="60" height="60" style="height: 96px; width: 359px; "><form>

change it too

<input type="image" src="Pictures\myweapon3.jpg" name="image" width="60" height="60" style="height: 96px; width: 359px; "><form>
#3. Posted:
Pinguicula
  • Resident Elite
Status: Offline
Joined: Apr 27, 201113Year Member
Posts: 250
Reputation Power: 9
Status: Offline
Joined: Apr 27, 201113Year Member
Posts: 250
Reputation Power: 9
Cloud9Fx wrote -snip-


I'm aware if that I just changed the location to %username% instead of the actual user.
#4. Posted:
speed
  • Winter 2020
Status: Offline
Joined: Jun 11, 200914Year Member
Posts: 9,897
Reputation Power: 3160
Motto: "I'l no I grew up to fast speed I no u will be little famous" - Famous_Energy
Motto: "I'l no I grew up to fast speed I no u will be little famous" - Famous_Energy
Status: Offline
Joined: Jun 11, 200914Year Member
Posts: 9,897
Reputation Power: 3160
Motto: "I'l no I grew up to fast speed I no u will be little famous" - Famous_Energy
You'd need javascript to do it.

Actually, none of what you're trying to do is possible with HTML. HTML alone can't handle form submissions.
#5. Posted:
Pinguicula
  • Resident Elite
Status: Offline
Joined: Apr 27, 201113Year Member
Posts: 250
Reputation Power: 9
Status: Offline
Joined: Apr 27, 201113Year Member
Posts: 250
Reputation Power: 9
SPEED wrote You'd need javascript to do it.

Actually, none of what you're trying to do is possible with HTML. HTML alone can't handle form submissions.


Appreciate it Speed, I was under the impression that it was possible with the LQ YouTube Tuts... Do you have any HTML/JAVA tuts you'd recommend?
#6. Posted:
Nic
  • Retired Staff
Status: Offline
Joined: Jun 08, 201013Year Member
Posts: 2,466
Reputation Power: 1070
Motto: I've been watching you all day.
Motto: I've been watching you all day.
Status: Offline
Joined: Jun 08, 201013Year Member
Posts: 2,466
Reputation Power: 1070
Motto: I've been watching you all day.
Like Speed said, what you want isn't possible with just HTML. With HTML you can pretty much only make the layout.

If you want to make it secure with the password then I suggest you use PHP and a MySQL database to store the passwords. Javascript can work but is less secure as a user can see all the scripts, which is not the case with PHP.
You do need Javascript in case someone enters an invalid password and want a popup to be displayed. You can also use jQuery instead, which is basically a Javascript library that's a bit easier to work with.

A simple popup using Javascript: [ Register or Signin to view external links. ]
More advanced and better looking popups using jQuery: [ Register or Signin to view external links. ]
#7. Posted:
Diablo_Botter
  • New Member
Status: Offline
Joined: Oct 27, 201211Year Member
Posts: 10
Reputation Power: 0
Status: Offline
Joined: Oct 27, 201211Year Member
Posts: 10
Reputation Power: 0
Yes, it is possible. It's actually not that hard to make. If you are trying to protect against bruteforcers or something, I would go with the distorted text field.
#8. Posted:
zazmodz
  • Junior Member
Status: Offline
Joined: Nov 11, 201211Year Member
Posts: 74
Reputation Power: 4
Status: Offline
Joined: Nov 11, 201211Year Member
Posts: 74
Reputation Power: 4
This will help with the popup

function popup(url){
cuteLittleWindow = window.open(url, "littleWindow", "location=no,width=338,height=215");
}

then add

<a href="javascript:popup('URL')">click here</a>
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.