Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

HTML need help on forms

views
     
zBuffer
post Jun 25 2008, 07:21 PM

Getting Started
**
Junior Member
157 posts

Joined: Jan 2003
From: KayEL



Need your complete HTML code for the form or else I don't understand how your DOM looks like.

Your code should basically look like this:
CODE
<form name="myform" action="input.php" method="get">
<input type="text" name="field1" />
<input type="text" name="field2" />
<input type="hidden" name="field3" />
<input type="submit" name="submit" onclick="document.myform.field3.value=document.myform.field1.value+document.myform.field2.value; return true;"/>
</form>


Though I think by exactly according to your specs, it should look like this:
CODE
<form name="myform" action="input.php" method="get">
<input type="text" name="field1" />
<input type="text" name="field2" />
<input type="button" value="Submit" onclick="document.location=document.myform.action+'?field3='+document.myform.field1.value+document.myform.field2.value;"/>
</form>


*pardon my text boxes, I'm lazy to do list boxes.*

This post has been edited by zBuffer: Jun 25 2008, 07:36 PM
zBuffer
post Jun 27 2008, 12:43 AM

Getting Started
**
Junior Member
157 posts

Joined: Jan 2003
From: KayEL



Look at my second example. Try it. I'm not sure if it works on IE, but it works on Firefox.
zBuffer
post Jun 27 2008, 03:59 AM

Getting Started
**
Junior Member
157 posts

Joined: Jan 2003
From: KayEL



Note: onclick is already a JavaScript event, I believe placing "javascript:" will be a syntax error.
zBuffer
post Jun 28 2008, 11:55 AM

Getting Started
**
Junior Member
157 posts

Joined: Jan 2003
From: KayEL



DOM is document object model, it is closely related to JavaScript as it (JavaScript) accessed objects based on DOM.

@abubin:
From your response, it seems like my code works on your browser. That means the problem lies in your code, if you don't post your code, you can't get any help.

POST is as easy to manipulate as GET (it is still clear text). I laugh at the web apps people made for competitions relying on POST on such an unsecured manner. What I do is I create a form and POST the scores without playing the game. (or even flooding their database with invalid scores)

IMHO, using a library just for submitting forms is kinda overkill. The decision is still up to you though.


Edit: Ambiguity

This post has been edited by zBuffer: Jun 28 2008, 12:04 PM

 

Change to:
| Lo-Fi Version
0.0166sec    0.53    6 queries    GZIP Disabled
Time is now: 29th November 2025 - 06:13 AM