Come validare in w3c il carrello di paypal?

  • Creatore Discussione Creatore Discussione ghisirds
  • Data di inizio Data di inizio

ghisirds

Utente Attivo
4 Mag 2007
227
0
16
Ciao a tutti.
Dopo ore perse inutilmente, non sono riuscito a far validare il carrello fornito da paypal: mi da un sacco di errori che non riesco a risolvere.
Il codice fornito da loro è questo per visualizzare il carrello:

HTML:
<form name="_xclick" target="paypal" action="https://www.paypal.com/it/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="me@mybusiness.com">
<input type="image" src="https://www.paypal.com/it_IT/i/btn/view_cart.gif" border="0" name="submit" alt="Effettua i tuoi pagamenti con PayPal. È un sistema rapido, gratuito e sicuro.">
<input type="hidden" name="display" value="1">
</form>

Mentre è questo per il pulsante aggiungi al carrello:

HTML:
<form name="_xclick" target="paypal" action="https://www.paypal.com" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="me@mybusiness.com">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="item_name" value="HTML book">
<input type="hidden" name="amount" value="24,99">
<input type="image" src="http://www.paypal.com/it_IT/i/btn/sc-but-01.gif" border="0" name="submit" alt="Effettua i tuoi pagamenti con PayPal. È un sistema rapido, gratuito e sicuro.">
<input type="hidden" name="add" value="1">
</form>

Come doctype utilizzo questo:

HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it">

Uno degli errori che più comunemente mi riporta è questo:

document type does not allow element "form" here; missing one of "object", "applet", "map", "iframe", "ins", "del" start-tag.

….com/it/cgi-bin/webscr" method="post">

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

oppure questo:

end tag for "input" omitted, but OMITTAG NO was specified.

<input type="hidden" name="cmd" value="_cart">

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

e a volte altri.
Qualche anima pia sa come correggere il codice una volta per tutte così che vada bene per sempre?
Grazie mille e un saluto

__________________
sito sulla filosofia on line, forum scuola primaria, nuovi regali bambini (original gift in inglese)
 
Per il modulo prova cosi

<form name="_xclick" id="mod_paypal" action="https://www.paypal.com" method="post">
<input id="" type="hidden" name="cmd" value="_cart"/>
<input id="" type="hidden" name="business" value="me@mybusiness.com"/>
<input id="" type="hidden" name="currency_code" value="EUR"/>
<input id="" type="hidden" name="item_name" value="HTML book"/>
<input id="" type="hidden" name="amount" value="24,99"/>
<input id="" type="image" src="http://www.paypal.com/it_IT/i/btn/sc-but-01.gif" border="0" name="submit" alt="Effettua i tuoi pagamenti con PayPal. È un sistema rapido, gratuito e sicuro."/>
<input id="" type="hidden" name="add" value="1"/>
</form>

Ho tolto il "target" al <form>, ma non so se gli serve per qualcosa...

Assegna ad ogni "id" dei tag <input> un valore univoco.
 
Assegna ad ogni "id" dei tag <input> un valore univoco.

ma cosa vuol dire scusa?
infatti mi da errore proprio li, ma che ci devo mettere?

syntax of attribute value does not conform to declared value.

<input id="" type="image" src="http://www.paypal.com/it_IT/i/btn/sc-but-01.gif"



The value of an attribute contained something that is not allowed by the specified syntax for that type of attribute. For instance, the “selected” attribute must be either minimized as “selected” or spelled out in full as “selected="selected"”; the variant “selected=""” is not allowed.

da errore anche in border

there is no attribute "border".
…om/it_IT/i/btn/sc-but-01.gif" border="0" name="submit" alt="Effettua i tuoi p



You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

grazie
ciao
 
Eddai, un po di fantasia :-)

<form name="_xclick" id="mod_paypal" action="https://www.paypal.com" method="post">
<input id="id_cmd" type="hidden" name="cmd" value="_cart"/>
<input id="id_business" type="hidden" name="business" value="me@mybusiness.com"/>
<input id="id_currency_code" type="hidden" name="currency_code" value="EUR"/>
<input id="id_item_name" type="hidden" name="item_name" value="HTML book"/>
<input id="id_amount" type="hidden" name="amount" value="24,99"/>
<input id="id_submit" type="image" src="http://www.paypal.com/it_IT/i/btn/sc-but-01.gif" border="0" name="submit" alt="Effettua i tuoi pagamenti con PayPal. È un sistema rapido, gratuito e sicuro."/>
<input id="id_add" type="hidden" name="add" value="1"/>
</form>
 
Eh, io la fantasia ce la posso anche mettere, ma prima di arrivare a capire ste cose...:book: scrivo un libro come harry potter!:mavieni:

Comunque, ora va tutto tranne il border:

Line 38, Column 96: there is no attribute "border".

…om/it_IT/i/btn/sc-but-01.gif" border="0" name="submit" alt="Effettua i tuoi p



You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

Che faccio, lo tira via di brutto o si corregge in un qualche modo da passare la validazione?
Grazie ancora
Ciao ciao
 
Ma si il border si può togliere.
Anche il codice per la "ricerca su google" da il border ma si può togliere per passare la validazione.

E lo stesso faccio con il codice del mio contatore per le visite. Ottimizzo e tiro via il border=0.

No te procupe.
 
Ma si il border si può togliere.
Anche il codice per la "ricerca su google" da il border ma si può togliere per passare la validazione.

Ecco, già che siamo in argomento mi dici anche il codice validato della ricerca su google? Era un altro dei problemi che dovevo risolvere, e già che l'hai buttata li...:jolly:
Grazie anticipato
ciao
 
Intende il codice che google fornisce ai publisher per implementare la barra di ricerca nei propri siti e trarne profitto dai click sui link sponsorizzati dei risultati della ricerca. si possono anche far comparire i risultati sul proprio sito.
 
Il problema è lo standard che pensi di voler usare. Il codice che passa google per la ricerca è vecchio, credo che sia buono per un html 4.1 transitional o simile.
Devi correggerlo pezzettino per pezzettino, e credo che oltre l'xhtml transitional non riesci.


Se usi lo standard xhtml 1.0 strict o superiori non riesci a validarlo.
Te lo tieni così com'è, funziona lo stesso ma non passa il w3c.
 
Ecco il codice:

Codice:
<!-- SiteSearch Google -->
<form method="get" action="http://www.google.it/custom" target="_top">
<table border="0" bgcolor="#99ffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">

</td>
<td nowrap="nowrap">
<input type="hidden" name="domains" value="www.sito.it"></input>
<label for="sbi" style="display: none">Inserisci i termini di ricerca</label>
<input type="text" name="q" size="31" maxlength="255" value="" id="sbi"></input>
<label for="sbb" style="display: none">Invia modulo di ricerca</label>
<input type="submit" name="sa" value="Ricerca Google" id="sbb"></input>
</td></tr>
<tr>
<td>&nbsp;</td>
<td nowrap="nowrap">
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value="" checked id="ss0"></input>
<label for="ss0" title="Ricerca nel Web"><font size="-1" color="black">Web</font></label></td>
<td>
<input type="radio" name="sitesearch" value="www.sito.it" id="ss1"></input>
<label for="ss1" title="Cerca www.sito.it"><font size="-1" color="black">www.sito.it</font></label></td>
</tr>
</table>
<input type="hidden" name="client" value="pub-4567567567"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="456745678456"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input>
<input type="hidden" name="hl" value="it"></input>
</td></tr></table>
</form>
<!-- SiteSearch Google -->

Da dove si comincia per correggerlo?
Grazie
 
Dipende dallo standard.
Se lo vuoi per un xhtml, c'è poco da fare. Tecnicamente potresti anche, ma ci sono dei "ma".

A occhio questo è il codice per integrare la ricerca di google insieme alla ricerca nel tuo www.sito.it.

Puoi provare a traudurlo in html4.1.

Ma questo solo se proprio vuoi avere la validazione w3c.

Tieni conto che tutti gli attributi legati a colore-posizione-dimensione delle tabelle sono fuori standard per l'xhtml.

Se pensi di usarlo su una sola pagina del sito puoi anche metterlo così, pazienza per il w3c per quella pagina.

Potresti anche invece averne bisogno davvero su tutto il sito.
Allora devi tirar via moltissimo e modificare il css riportando gli attributi fuori dalla pagina, iscrivendoli sul css stesso del sito o della pagina.
Css che ovviamente non avrà configurate le tabelle, quindi devi farlo a mano e di persona, da zero.

Tecnicamente si può fare. Prima di avventurarti però considera l'ultimo "ma".

Questo codice rimanda al tuo account publisher di Google.
Se tu intervieni sugli attributi grafici non tocchi lo script (su questo Luke può rassicurarti) nè gli attributi del publisher.
MA devi poi verificare che la modifica non rimanga indigesta al gestore java degli id degli account google.

Ti dico questo perchè io poi ho rinunciato. La colpa è di GG che non si aggiorna, ovvio.

Comunque la correzione è anche semplice. Io carico il codice su dreamweaver e imposto le opzione per la convalida.
Lui ti indica tutti gli errori, che tu a quel punto correggi.
Ma appunto nei limiti dello standard che ti interessa.
L'xhtml 1.0 stricht rifiuta tutti gli attributi per colore-posizione-dimensione, quindi li devi trasferire UGUALI sul csss esterno.

Più facile la correzione se rinunci alla ricerca interna al tuo sito.
(vale a dire SOLO la barretta di ricerca google SENZA il CERCA in www.sito.it).

Mi dispiace se sono stato arzigogolato. Mi dispiace anche che non sia più immediata la procedura.

Colpa di Google. Ma , ultimo MA, tieni anche conto che sono appena usciti nuovi standard, su cui ancora non sono aggiornato.
C'è l'xhtml 1.1 e ora anche l'html 5 (ancora solo sulla carta, ma intanto sulla carta è stato pubblicato...).

Quindi è tutto transitorio, come sempre nel web.

Io uso dreamweaver 8. Il CS3 sto per istallarlo. Ha discrete funzionalità per la correzione degli errori e per il controllo delle convalide.

Tu come editi?
 
Dreamweaver 8 pure io...!
Comunque lascio tutto così, tanto è una pagina interna: la pagina delle faq!
Grazie
Ciao
 

Discussioni simili