I want to add an attribute to a html form.
The html code is
<input type="text" name="nm-form-meta[<?php echo $tag?>]" id="<?php echo $tag.'-'.$widget_id?>" class="nm_mc_input" />n
dynamic content is $tag , it gives two values in two 'text box' output.
<input type="text" name="nm-form-meta" will add value =" Enter your email"
<input type="text" name="nm-form-meta[FNAME]" will add value =" Enter your email"
i tried with php like this
<input type="text" name="nm-form-meta[<?php echo $tag?>]" value=" <?php if ($tag="EMAIL") { echo "Enter your email";} else { echo "enter your Name";} ?>" id="<?php echo $tag.'-'.$widget_id?>" class="nm_mc_input" />n
but it did not work.
i putted this jquery code in head tag
<script type="text/javascript">
$('#nmedia_mail_chimp-2 input[name="nm-form-meta[EMAIL]"]').attr('value', 'email');
$('#nmedia_mail_chimp-2 input[name="nm-form-meta[FNAME]"]').attr('value', 'First name');
</script>
does not work either.
how can i implement this. Please help me
The html code is
<input type="text" name="nm-form-meta[<?php echo $tag?>]" id="<?php echo $tag.'-'.$widget_id?>" class="nm_mc_input" />n
dynamic content is $tag , it gives two values in two 'text box' output.
<input type="text" name="nm-form-meta" will add value =" Enter your email"
<input type="text" name="nm-form-meta[FNAME]" will add value =" Enter your email"
i tried with php like this
<input type="text" name="nm-form-meta[<?php echo $tag?>]" value=" <?php if ($tag="EMAIL") { echo "Enter your email";} else { echo "enter your Name";} ?>" id="<?php echo $tag.'-'.$widget_id?>" class="nm_mc_input" />n
but it did not work.
i putted this jquery code in head tag
<script type="text/javascript">
$('#nmedia_mail_chimp-2 input[name="nm-form-meta[EMAIL]"]').attr('value', 'email');
$('#nmedia_mail_chimp-2 input[name="nm-form-meta[FNAME]"]').attr('value', 'First name');
</script>
does not work either.
how can i implement this. Please help me
Last edited: