Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Form text input issue
06-08-2009, 08:14 PM #1
- Join Date
- Jun 2009
- Thanked 0 Times in 0 Posts
Form text input issue
I have a little problem with this code :
What may be the problem since onChange and onclick do the same thing here ?
06-08-2009, 11:29 PM #2
- Join Date
- Jan 2006
- Halle (Saale), Germany
- Thanked 1,091 Times in 1,063 Posts
Firstly: Your code is wrong.
- It lacks a document type definition (DTD). You should define your document as HTML or XHTML strict.
nameattribute is deprecated on all elements except form controls (input, select, and textarea). For the form you have to use
- A form requires an
actionattribute with a reference to a file that is processing the form input (server side). And in the course of this it also needs a method how the data is sent (“GET” or “POST”).
- Form controls must not be direct children of a form, they have to be inside some other block element such as
- You should always attach labels to your form controls for accessibility reasons.
scrollingattributes are deprecated and/or not allowed. Use CSS to style your page.
Secondly: A submit button typically submits a form. So, the action it performs (or the event that occurs, respectively) when you click it is “submit”. Hence, the JS event you should use is
onsubmitto execute the function (and maybe add
return falseto prevent the form from actually submitting).
Lastly: Try changing
DISPLAY.src = GET_URL.url.valueto
document.getElementById('DISPLAY').src = document.forms['GET_URL'].url.value
Last edited by VIPStephan; 06-08-2009 at 11:56 PM.