Quantcast
Channel: WordPress.org Forums » [Contact Form 7] Support
Viewing all articles
Browse latest Browse all 49501

gabrielzios on "[Plugin: Contact Form 7] Add/Remove Field"

$
0
0

Ok, I've been able to create the code, but I have no idea how to add it to my CF7 form.

Here is the code:

<html>
<head>
<title> Pedidos </title>
<script  src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
var addDiv = $('#addinput');
var i = $('#addinput p').size() + 1;

$('#addNew').live('click', function() {
$('<p><input type="text" id="p_new" size="20" name="p_new_' + i +'" value="" placeholder="N Ref" /><input type="text" id="p_new" size="20" name="p_new_' + i +'" value="" placeholder="Color" /><input type="text" id="p_new" size="20" name="p_new_' + i +'" value="" placeholder="Talla" /><input type="text" id="p_new" size="20" name="p_new_' + i +'" value="" placeholder="Cantidad" /><a href="" id="remNew">Eliminar [-]</a> </p>').appendTo(addDiv);
i++;

return false;
});

$('#remNew').live('click', function() {
if( i > 2 ) {
$(this).parents('p').remove();
i--;
}
return false;
});
});

</script>

</head>
<body>
<h2>Pedidos</h2>

<div id="addinput">
<p>
<input type="text" id="p_new" size="20" name="p_new" value="" placeholder="N Ref" /><a href="" id=""></a><input type="text" id="p_new" size="20" name="p_new" value="" placeholder="Color" /><a href="" id=""></a><input type="text" id="p_new" size="20" name="p_new" value="" placeholder="Talla" /><a href="" id=""></a><input type="text" id="p_new1" size="20" name="p_new1" value="" placeholder="Cantidad" /><a href="" id="addNew">  Mas [+]</a>
</p>
</div>

</body>
</html>

But if I copy this to my CF7 does not add the second row if I click on Mas [+]

The placeholders are in Spanish, but I guess that does not matter to get some help :)

And if I can send the form through email that will be super great.


Viewing all articles
Browse latest Browse all 49501

Trending Articles