|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Submiting a form as an attachment to an email
Scratch that crap I just realized I am being like all those ppl I dont like and submitting questions that are to broad and doing little research before posting. SO, let me define my question a little bit. I'm trying to write a script that will take four variables from a text input field and one drop down box and then writing them below for any number of times until the person submits it. The problem I am having is how do I use the text fields in the java script, do I use the name as the variable or the value? I get a lot of info on the java script on the net but not a lot of the combo html and java working together.
Code:
<script language='javascript'>
var string1 = +id;
var string2 = +type;
var string3 = +mode;
function add()
{
document.write(+id," "+type+" "mode+);
}
</script>
I got something like that just as a starter but then the html code is Code:
<input type='text' name='id' > <input type='text' name='type' > <input type='text' name='mode' > <input type='button' value='add' onclick='add()'> so basically I want to use, user input and then write it below, how do I declare a user defined variable to do this? Secondly=can someone give me some good links to javascript examples and tutorials. I have an understanding of C/C++ and see that its not much different in some aspects but the id's and crap are throwing me a little.
__________________
---Official Member Of The Itsacon Fan Club--- ![]() Give a man a fish and he will eat for a day. Teach a man to fish and he will sit in a boat all day drinking beer. Last edited by Geo.Garnett : February 23rd, 2006 at 10:16 PM. |
|
#2
|
||||
|
||||
|
javascript and form elements
Ah, the DOM! (document object model) You can get the values of form elements using getElementById
I believe that document.write will create a new document in the window. You may want to look into createElement too. You could google for - DOM tutorial - and get lots of results. Here's one http://www.howtocreate.co.uk/tutorials/index.php?tut=0&part=24 |
|
#3
|
||||
|
||||
|
Thx for the tip Mittineague that was pretty much what I was looking for. Its not like in C++ were you can declare a variable to use and then use is you gotta give the path to it, which was kinda difficult for me to understand, and Im kinda still puzzled by it just a little. But definately that link explained a great deal.
![]() I have also found another link to another good source of information on this subject just incase anyone else is interested Link Last edited by Geo.Garnett : February 26th, 2006 at 06:25 PM. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Submiting a form as an attachment to an email |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|