PHP - Form Php Javascript

 
Vista:
sin imagen de perfil

Form Php Javascript

Publicado por rosmilton (2 intervenciones) el 14/08/2014 00:01:27
Tengo un problema con 1 form que tiene 2 botones, lo que quiero hacer es realizar la accion que hace el primer boton siempre, que el usuario no tenga que elegir entre 1 o otro. Este es el codigo:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<form action="javascript:;" method="post" id="new_account_form" class="std" autocomplete="on" autofill="on">
<fieldset>
<h3 id="new_account_title">{l s='New Customer'}</h3>
<div id="opc_account_choice">
<div class="opc_float">
<p class="title_block">{l s='Instant Checkout'}</p>
<p>
<input type="button" class="exclusive_large" id="opc_guestCheckout" value="{l s='Guest checkout'}" />
</p>
</div>
 
<div class="opc_float">
<p class="title_block">{l s='Create your account today and enjoy:'}</p>
<ul class="bullet">
<li>{l s='Personalized and secure access'}</li>
<li>{l s='A fast and easy check out process'}</li>
<li>{l s='Separate billing and shipping addresses'}</li>
</ul>
<p>
<input type="button" class="button_large" id="opc_createAccount" value="{l s='Create an account'}" />
</p>
</div>
<div class="clear"></div>
</div>
<div id="opc_account_form">
{$HOOK_CREATE_ACCOUNT_TOP}
<script type="text/javascript">
// <![CDATA[
idSelectedCountry = {if isset($guestInformations) && $guestInformations.id_state}{$guestInformations.id _state|intval}{else}false{/if};
{if isset($countries)}
{foreach from=$countries item='country'}
{if isset($country.states) && $country.contains_states}
countries[{$country.id_country|intval}] = new Array();
{foreach from=$country.states item='state' name='states'}
countries[{$country.id_country|intval}].push({ldelim}'id' : '{$state.id_state}', 'name' : '{$state.name|escape:'htmlall':'UTF-8'}'{rdelim});
{/foreach}
{/if}
{if $country.need_identification_number}
countriesNeedIDNumber.push({$country.id_country|in tval});
{/if}
{if isset($country.need_zip_code)}
countriesNeedZipCode[{$country.id_country|intval}] = {$country.need_zip_code};
{/if}
{/foreach}
{/if}
//]]>
{literal}
function vat_number()
{
if (($('#company').length) && ($('#company').val() != ''))
$('#vat_number_block').show();
else
$('#vat_number_block').hide();
}
function vat_number_invoice()
{
if (($('#company_invoice').length) && ($('#company_invoice').val() != ''))
$('#vat_number_block_invoice').show();
else
$('#vat_number_block_invoice').hide();
}
$(document).ready(function() {
$('#company').on('input',function(){
vat_number();
});
$('#company_invoice').on('input',function(){
vat_number_invoice();
});
vat_number();
vat_number_invoice();
{/literal}
$('.id_state option[value={if isset($guestInformations.id_state)}{$guestInformat ions.id_state|intval}{/if}]').prop('selected', true);
$('.id_state_invoice option[value={if isset($guestInformations.id_state_invoice)}{$guest Informations.id_state_invoice|intval}{/if}]').prop('selected', true);
{literal}
});
{/literal}
</script>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de xve
Val: 3.943
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

Form Php Javascript

Publicado por xve (6935 intervenciones) el 14/08/2014 15:04:56
Hola Rosmiltos, estas utilizando algún framework?? hay cosas que no se interpretar como por ejemplo: {/literal}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Form Php Javascript

Publicado por rosmilton (2 intervenciones) el 14/08/2014 16:01:48
El framework es prestashop 1.5 y lo que quiero es ocultar un form pero realizar la accion del primer boton.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar