using html forms in jsp file - html

I have a very simple question....I have multiple jsp files like login.jsp , Registration.jsp , forgetpassword.jsp each having their owm forms to take input from user. So, my question is.....Is it OK to have these many files or should I include all my html forms in a single file like user_auth.jsp and use javascript[Which i have no idea how to do] to display them individually......
All these files process the inputs taken by user against mysql database. I am using Struts 1.3.8 framework...

I don't think that anybody would argue that you should have all of those forms in a single file. Most web pages will have some sort of form on them, it's just how it goes. I would stick with your current model.

Related

How can I pass a data element that has been bound on one HTML file to another HTML file in an AngularJS app

I am using this statement in the Index.html file to bind the element: Show Products.
I see that is is bound in the Index fie by displaying its value there. But when the products1.html file opens, the bound field does not display. I want to use it in as a placeholder in an input box in products1.html.
I am thinking of re-creating index.html as an SPA, but not sure this will work. if I add products1.html as a template into the view. I expect I might have the same problem.
Yes I am a Angularjs newbie after 2 years of experience.
Assuming that you have different controllers for the two pages, it seems that your problem is that you are not sharing the data between those controllers. Each of the controllers define a scope. It looks like the information that you want to show is well loaded in the "Index.html" controller scope, but then is not passed to the "products1.html" controller. If that is the case, there is several solutions to share data between Angular controllers:
Using services
Using $state.go services
Using stateparams
using rootscope
You can check how to do it in: Share data between AngularJS controllers

How to add manage temparory data in DotnetNuke?

I am beginner in DNN. I am creating a module which provides Login, Dashboard and Add-Update Form. I have data in JSON format. I want to store it temparory while user use the website. Data will be destroy as soon as user will close the website.
Currently I have created a folder in my Solution Explorer of project in Visual Basic and created 3 .json files which stores login_info.json, basic_info.json and auth_info.json. I write json data whenever user login and I make it blank when user logout.
Above method is working fine now but I afraid it will work when I will publish this module.
Also I may have situation where I need to store image some where. I don't know how I will manage.
Can anybody please guide me?
Is this proper way to store data temparory in DNN?
Is there any other better way?
After getting one of reply for Database Suggestion
Is there any table which same as User Meta in DotnetNuke?
You use the ConnectionString that is used by DNN and access the database as you would normally.
DotNetNuke.Common.Utilities.Config.GetConnectionString()
Or you can use the Data Access Layer that the DNN Framework supplies. For that take the Christoc Templates. In there is all you need to communicate with the DB.

Storing value of one HTML page and storing in database and using it again in another HTML page

I want to know that as I am using a number of HTML pages with different JavaScript codes and in one HTML page it shows total sales (the value will be entered by user) column which is multiplied by price (value will be entered by user) which will show the answer in next column. I want to use that answer in my next HTML page automatically or just by clicking one button by user.
How can I do that? Do I have to link .js file in script tag in another HTM page or I have to store the answer in database if I have to store. And if I have store answer in database how can I use it in another HTML page?
If you want to store data into a database. you need to use PHP and SQL. I recommend PDO and mysql.
Here is a w3c page on how to setup a connection:
connection to MYSQL with PHP

django allauth how to make a custom design html

I know there's a lot of documentation over the topic, this one, and this one but i couldn't find one that explains so that a 5 year old - or a designer - could understand :) .
My knowledge is html and css, and I need to design the templates for the user login process using Django AllAuth. I'm alone in this one, with no knowledge of python.
Someone please point me to some good documentation to help answering my question:
1 - How can I design each account/page html if I don't know what element is coming? Do I need to work on the views.py file? (possible to do so without any python knowledge?)
2 - how can I actually test all error messages without having to go thru all the login steps every time?
Thank you, guys
I did something like this. It was for django-registration, but the idea is the same.
-Go to github, and clone all the templates. In case, you are not familiar, there will be a folder called templates inside allauth app folder, and download the whole folder. Inside it , there will be base.html, and a folder called allauth.
-base.html is not needed, and you can delete it.
-inside all-auth folder, you will have a bunch of self-evident html files. Open the files, now, the only important content lies between {% block content %}{% endblock %}. Copy that to the html files you want, but make sure to have the same file name; otherwise, allauth woent recognize.
-If you want even more customization, run server, obtain the (soem name)" html codes, and you will see a bunch of html form fiels with id = "(some name)" and name = "". These are HTML fields. As long as you keep the same id and name for each field, you can use them however you want.
Summary: Run server with default allauth templates that you get from github. Go to source of the django generated html files. Copy all the fields that are relevant, and use them however you want.
I know I am not full clear, but it is somewhat a long process.
Here is the official django page: https://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-form-template

Adding forms to joomla's front end component view

I'm developing a component using joomla 3.0. I'm trying to add forms in my component. I saw that joomla has the JHTML class for adding forms in backend.
what is the recommendation for creating forms in frontend. should I use JHTML or clean html markup ? and where can I find docs for that class.
JForm
JModelForm
JControllerForm
Forms which save data in the databas in Joomla 1.6 + mainly use the JForm package which manages forms (xml or xml strings), fields (the actual fields) and rules (validation).
The normal way simple way to manage it is to extend JModelForm and JControllerForm. If you look in the core you'll see these extended in places you might not expect such as the single contact view but basically that's because those classes provide the basic set up you need to manage a form on any part of your page even if the rest of it has nothing to do with forms.
Alternatively you can always create a new JForm object.
If you have a models folder usually you would have a forms folder and then if needed fields and rules folders. THe latter two contain any custom fields or rules you may need for your extension. These will be found by default when building a form in your extension but if you want them from somewhere else you would need to use addFieldPath or addRulePath or addFormPath as needed in you form xml.
Jform provides a standard set of fields and rules as well as a standard list of filters. Rules means validation while filters will change the saved values. You can also use any filter available in JFilterInput.
If you give a field the same name as a field in the current table object the data will automatically be saved in that field. if you use a fields tag with an name that matches a field by default the fields listed inside the tag will be saves as a JSON string within that field.
That's pretty much the basics, though there is a lot more.
One important thing for me is that if you use JForm the default filtering is very good and you selectively allow html etc so by default it is very secure.