Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a javascript download button 2

Status
Not open for further replies.

Chomauk

Programmer
Jun 8, 2001
130
I have two buttons, one for downloading and the other to print the page. After I finished writing the code(which works) I decided to validate it all using the W3C Markup Validation Service and I got this message:

Line 151, column 5: required attribute "ACTION" not specified

<form>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.


Here is my code:
Code:
<form>
<input type="button" value="Download" 
onclick="document.location.href='[URL unfurl="true"]http://www.somewetsite.com/aword.doc'">[/URL]

<SCRIPT LANGUAGE="JavaScript">
if (window.print) 
{
document.write('<input type=button name=print value="Print" '
+ 'onClick="javascript:window.print()">');
}
</script>
</form>
I understand the message and I've tried different combinations and searched Google for help to get it to work AND validate but no luck. Now, once again I ask you, the fine people of Tek-tips to help me solve this problem.

thanks

"In great attempts it is glorious even to fail."
either Unknown or Vincent Thomas "Vince" Lombardi
Depends on what source you find
 
Curious, have you just tried putting action="" in the FORM tag?

--Dave
 
What this is saying is that when you have a form, typically you have information that you want to submit. When you submit information from a page (using a submit button, or other objects that will handle events) it is submitted to the page specified by the action attribute in the form tag. Since it doesn't look like you're submitting anything, if you'd like it to run fine thru the validator you could probably just do this:
Code:
<form action=''>

-kaht

banghead.gif
 
That did...man you guys are good.

Thanks again.

"Failure is the tuition you pay for success."
~ Walter Brunell ~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top