473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

creating a form using Javascript

Hello,

I'm making a nice little login box in Javascript but having problems Posting
the value inside a textfield.
In a nutshell:

I have a function:

function getPostData (value)

Which correctly gets the value, but how do I then create a form and submits
inside Javascript?

Help much appreciated,

Frederik Sunne
Jul 20 '05 #1
2 8169
Frederik S wrote on 15 nov 2003 in comp.lang.javascript:
I'm making a nice little login box in Javascript but having problems
Posting the value inside a textfield.
In a nutshell:

I have a function:

function getPostData (value)

Which correctly gets the value, but how do I then create a form and
submits inside Javascript?


A form is HTML, so you cannot make a form inside javascript.
What you can do is have javascript make the HTML for you.
What you can do is javascript submit the HTML form
with a onclick="submit()".

It is very unclear what getPostData() does if you do not show the function
script and what "value" should contain.

Please show us and explain what you want to do.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
Mr. Evertjan is right, Forms are created by using HTML tags. You may
however define functions that relate to the form withing JavaScript tags.
Inside the script tags are where you declare your javascript variables,
assign objects and declare functions. Using Event handlers withing the HTML
form such as onClick you may call your functions.

An example might be:

<form name="myform">

<input type="button" name="Button1" value="Vector 1"
onClick="swap1();">
<input type="button" name="Button2" value="Vector 2"
onClick="swap2();">
<input type="button" name="Button3" value="Vector 3"
onClick="swap3();" >
<input type="button" name="Button4" value="Vector 4"
onClick="swap4();" >
</form>

Good luck,

-Charlene
Intro. JavaScript
http://www.eclecticacademy.com

"Frederik S" <tr***********@hotmail.com> wrote in message
news:3f**********************@dread14.news.tele.dk ...
Hello,

I'm making a nice little login box in Javascript but having problems Posting the value inside a textfield.
In a nutshell:

I have a function:

function getPostData (value)

Which correctly gets the value, but how do I then create a form and submits inside Javascript?

Help much appreciated,

Frederik Sunne

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Don Stefani | last post by:
Hello, I have a form that I want to submit "onchange", OK I've got that working, but when the form submits, I want to pass along a value to a CGI script, as if that value was in a hidden form...
2
by: skubik | last post by:
I'm curious as to whether it's possible to create a Form object and populate it with form element objects, strictly in Javascript, without the need to apply the form to a document. Essentially,...
12
by: enak | last post by:
I have found some code that shows how to convert an html form to Word. The message said to simply put the following in the Page_load: Response.ContentType = "application/ms-word"...
2
by: DaWoE | last post by:
Hi all, I'm fairly new to ASP.NET. What i want to do is creat a online registration form. On the first step is getting the users details and the number of people he wants to register. Based on...
3
by: lcjohnso | last post by:
Hi all, Does anyone know if there is an easy way to create the html representation of an HTMLElement object in javascript? I'm attempting to update the innerHTML property of a div element to...
1
by: Luurs | last post by:
Hi All, I've been using a asp-label in the HTML <headsection for quite some time in order to dynamically generate meta-keywords,-description, css and js references. Though the actual...
1
by: TopherB | last post by:
Hi, First let me say that my knowledge of HTML and Javascript is fairly limited. But I am stuck in a situation of trying to adapt a website's shopping cart to a new one. Here's the problem, the...
5
eragon
by: eragon | last post by:
I wrote this function to create a new file when the user posts in my forums, and its not creating a new file, can you help me? this script is not copyrighted as the last one. function...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.