Link to home
Start Free TrialLog in
Avatar of Robert Granlund
Robert GranlundFlag for United States of America

asked on

Javascript not validating

Can someone shed light on why this line will not validate?

					<input type="hidden" name="n_submitted" document.getElementById('newsjoin').action="www.MYSITE.com" ; value="TRUE" />

Open in new window

Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

"document.getElementById" is javascript, not HTML or an HTML attribute.  It also won't do anything there because there is no way to execute it in a 'hidden' element even if you had a correct coding.
ASKER CERTIFIED SOLUTION
Avatar of Graham N.
Graham N.
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You cannot fire javascript without an event.

if you are trying to set the action on submit, the there should be an onsubmit event on the submit button or as the action of the form.

Cd&