+ 3

How to get the value from textboxes?

i have created login page I don't know how to get entered value from the textboxes https://code.sololearn.com/W17WX4Z8s85g/?ref=app

5th Nov 2017, 1:30 AM
Thirumurugan C
Thirumurugan C - avatar
5 Réponses
+ 6
Your code was fine for the most part, but if you're going to use [] you need to surround the form name and id's passed in quotes (see commented code below). Otherwise, just use dot notation instead. Also, I added some <br> tags for better readability of the output. function disp() { //var a=document.forms["f1"]["e1"].value; var a=document.forms.f1.e1.value; var b=document.forms.f1.p1.value; document.write("Your mail id is: " + a + "<br>"); document.write("Your password is: " + b + "<br>"); document.write("Do you like this code <br /> Give one thumbs up👍") }
5th Nov 2017, 1:52 AM
ChaoticDawg
ChaoticDawg - avatar
+ 4
Thank you 😊@chaoticDawg
5th Nov 2017, 7:50 AM
Thirumurugan C
Thirumurugan C - avatar
+ 3
Thanks @Aditya Maddheshiya sure i will start to learn JavaScript & Php
5th Nov 2017, 7:53 AM
Thirumurugan C
Thirumurugan C - avatar
+ 2
you need to learn php and javascript
5th Nov 2017, 1:40 AM
आदित्य मद्धेशिया
आदित्य मद्धेशिया - avatar
+ 2
Now run my code @ChaoticDawg all credits goes to you🎊🎉 https://code.sololearn.com/W17WX4Z8s85g/?ref=app
5th Nov 2017, 9:10 AM
Thirumurugan C
Thirumurugan C - avatar