I Agree Button

amir

No avatar

2005-09-02 00:14

Hello freinds
can somebody let me know how to put I agree Button with some text on order preview page and only after clicking I agree user must be able to procced with order.

amir

amir

No avatar

2005-09-04 18:25

hallo is somebody has idea

wewior (OpenSolution)

Avatar: wewior

2005-09-05 14:26

i think javascript can help here, disable submit button and then enable it after click on "i agree"

amir

No avatar

2005-09-05 16:26

Yeah but i want to add some text also like some agreement were i can add that text.

amir

ZSiGO

No avatar

2005-09-05 21:47

Add the below script to the <HEAD> section of head.tpl

<script>

//"Accept terms" form submission- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

var checkobj

function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){ //hunt down submit button
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}

function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("Please read/accept terms to submit form")
return false
}
}
}

</script>

and change this lines

<input type='hidden' name='fSummary' value='' />
<input type='submit' value='$lang[send]' class='submit' />
</td>
</tr>
</table>
</form>

to

<form name="agreeform" onSubmit="return defaultagree(this)">
Rest of your form here<br>
<input name="agreecheck" type="checkbox" onClick="agreesubmit(this)"&gt;<b>I agree to the above terms</b><br>
<input type='hidden' name='fSummary' value='' />
<input type='submit' value='$lang[send]' disabled class='submit' />
</td>
</tr>
</table>
</form>
</form>

in orders_delivery.tpl

sorry for my english

amir

No avatar

2005-09-06 15:17

Hey ZSiGO Thank you very much Your Script worked perfect. Thanx

amir

Back to top
about us | contact