how to post html data to .aspx file and save data - javascript

i want to crete some runtime control in asp.net hence i create one html file & for that i use JAVASCript for repeat that contols.i want to save the data enter into that control.but how it post to .aspx file & how the data save into database .please help me.

You can have a asp.net submit button on the page which posts everything on the server.
To read the values from the dynamically created DOM elements you will have to use the ASP classic like code - Request.Form['field-name']

Related

How to Submit Form data like files and text in Dynamic jquery form builder to C# Action method MVC?

I am using jquery Form Builder From for create Dynamic Form Creation for template purposes and use much time on my web site. Those forms but I am stuck in File Submission.
I don't know how to submit generated form with file upload Form builder give me only json ## Heading ## Result and file name into my json and I don't know how to upload File in my back end?

how to pass a javascript array object from a jsp page to another jsp page or servlets

The Problem is - i have generated a javascript JSON array (below screenshot) in a jsp page. Now i want to send that javascript array object from the current page(JSP) to another page(JSP or servlet). Please help.
Please provide me the alternative solutions as well which will work best.
************ To be more precise *****************
I am having a project which involves JSP and Servlets. Now there is index.jsp which asks a user to upload data sheet(excel sheet), the file is uploaded on the server by calling/sending the file through a servlet. That servlet then tries to extract the data(rows and columns) and generates a 2D Java array with same dimensions. This array is then sent to a JSP page (output.jsp) which gets this java array and converts it to JavaScript JSON array called as "data". I am performing some edit operations on this page and the changes gets affected in array accordingly. What i want is - I want to send that data array object to another jsp page where i can convert it into Java Array for further use.
you can probably save java script array object as a session attribute & get that in another JSP.
session.setAttribute("Object",object)
session.getAttribute("Object",object)

How to use functions within a PHP without soft coding it inside the actual HTML?

For example, in an HTML for registration once submitted executes the PHP file and whatever functions it has inside. I am trying to have the HTML registration form continue to another HTML registration form while performing the needed PHP code at the same time.
Registration.html > (Process PHP) > homePage.html ("Thank you for
registering!")
The way I learned to do it was through
registration.html > (process PHP) > homepage.PHP
If you are wondering why, it is because I can't display any of the HTML contents if the format is in PHP.
Thanks in advanced!
You can send the form data to the php page, which will process it, then once the data is processed you can redirect to another html file using
header("Location:homePage.html");

How to download a filled in form in PDF format using javascript or html

I have a html page with a form ,with few input fields, check box,radio buttons.
User can fill up the forms.
Is there any way , the user will be able to download the form (with the filled in data) in pdf format ?
1 more question, Any way to save the filled in form in html format or image format (of course File-> save of browser and screenshot are there) using java script code or html code , on a button click ?
I have tried http://code.google.com/p/jspdf/ , didnot able to get through it.
Thanks
[Adding a few more points]
if generating a pdf file using JS/HTML is not possible then ....
A bit more into it
Currently I am creating a server using C# application and when user requests a html page , I am sending the same to user.
that html page contains a form , which is needed to be filled
and I want the user to save the filled form in pdf format.
For now , I am able to process the static html form -> convert to pdf and provide the download to user ,
But can't get a way to enable the user to save the filled in form.
When the user presses the submit button , I can get all the filled in data using httpResponce object(GET/Post Method)!! , is there a way I can generate a pdf file using this httpResponce object parameters?
Or any way I can send the current html page content (e.g. getting all the contents in a div using jquery/javascript) and send it back, when user presses the submit button, in that way I can generate the pdf file at server side and provide a download - PDF format
Please ask , if I am not able to describe my question !!
jsPDF is an open-source library written by our lead developer, James,
for generating PDF documents using nothing but Javascript. You can use
it in a Firefox extension, in Server Side Javascript and with Data
URIs in some browsers. http://snapshotmedia.co.uk/blog/jspdf
Using only javascript to generate the PDF is not possible at this time. Using server-side scripting, it is possible to send the data to a server and let the server generate the PDF which is then sent to the user.
(Update): Using PHP, you can generate PDFs in the server-side using dompdf - HTML to pdf converter. Here is a demo: http://eclecticgeek.com/dompdf/docs_0-6-0/demo.php
In Google Chrome, there is a "Print to PDF" option. If you don't want to do any programming on the server side, you can just ask your users to access the page using Google Chrome. After filling out the form, they print the page as PDF.

Populating text fields using AJAX from JSP scriptlet with data obtained from Oracle 10g database

How do you populate text fields using AJAX from JSP scriptlet with data obtained from Oracle 10g database? How do you get a handle on those input elements of type text from a jsp? Using javascript? but how do you use the values in the scriptlet?
Thanks
Not sure if I understand what you mean.
You have JSP page that reads data from DB and some other page with text inputs. You want to populate these inputs with data from JSP using AJAX call, right ? So just write javascript that will hit JSP page and get a response in JSON format with data from DB and then populate the input fields.
If I am understanding your question right : Why not use a javascript templating engine and just populate and render the template with the json response? If you haven't used templates like this, I would probably investigate. There are quite a few options out there, Mustache is a decent one : http://mustache.github.com/. http://coenraets.org/blog/2011/12/tutorial-html-templates-with-mustache-js/

Categories