I have used the document.getElementbyID many times and it normally works for me… However this one has not cooperated with any of my attempts… Could someone take a look and maybe get me the correct path i have tried everything i can think of…if you scroll the file which is php and html you will see a couple of code attempts that did not work.
All I want to do is be able to replace each of the variables with new ones and it is just not working for me as usual… maybe someone can see what I am overlooking…
I have been able to use the old < echo ? = $var; ?> to interract with document but not here.
Thank you:
you will see 3 of these… my testing… not needed…
<?php
$first_name = "Tom"; echo "first_name = $first_name<br>";
$last_name = "Chandler"; echo "last_name = $last_name<br>";
$phone = "757-345-2345"; echo "phone = $phone<br>";
$user_email = "john@bond.com"; echo "user_email = $user_email<br>";
echo 'id="mauticform_input_gf_first_name" for first_name.';
echo "<br><br>";
?>
<form autocomplete="false" role="form" method="post" action="https://mydomain.com/form/submit?formId=3" id="mauticform_gf" data-mautic-form="gf" enctype="multipart/form-data">
<div class="mauticform-error" id="mauticform_gf_error"></div>
<div class="mauticform-message" id="mauticform_gf_message"></div>
<div class="mauticform-innerform">
<div class="mauticform-page-wrapper mauticform-page-1" data-mautic-form-page="1">
<div id="mauticform_gf_first_name" class="mauticform-row mauticform-text mauticform-field-1">
<input id="mauticform_input_gf_first_name" name="mauticform[first_name]" value="FIRSTNAMEXXX" class="mauticform-input" type="text">
<span class="mauticform-errormsg" style="display: none;"></span>
</div>
<document.getElementbyID("mauticform_input_gf_first_name").value=<? echo $first_name; ?>
<div id="mauticform_gf_last_name" class="mauticform-row mauticform-text mauticform-field-2">
<input id="mauticform_input_gf_last_name" name="mauticform[last_name]" value="LASTNAMEXXX" class="mauticform-input" type="text">
<span class="mauticform-errormsg" style="display: none;"></span>
</div>
<div id="mauticform_gf_phone" class="mauticform-row mauticform-tel mauticform-field-3">
<input id="mauticform_input_gf_phone" name="mauticform[phone]" value="PHONEXXX" class="mauticform-input" type="tel">
<span class="mauticform-errormsg" style="display: none;"></span>
</div>
<div id="mauticform_gf_email" class="mauticform-row mauticform-email mauticform-field-4">
<input id="mauticform_input_gf_email" name="mauticform[email]" value="EMAILXXX" class="mauticform-input" type="email">
<span class="mauticform-errormsg" style="display: none;"></span>
</div>
<div id="mauticform_gf_submit" class="mauticform-row mauticform-button-wrapper mauticform-field-5">
<button type="submit" name="mauticform[submit]" id="mauticform_input_gf_submit" value="" class="mauticform-button btn btn-default">Submit</button>
</div>
</div>
</div>
<input type="hidden" name="mauticform[formId]" id="mauticform_gf_id" value="3">
<input type="hidden" name="mauticform[return]" id="mauticform_gf_return" value="">
<input type="hidden" name="mauticform[formName]" id="mauticform_gf_name" value="gf">
</form>
</div>
</div>
</table>
</html>
document.getElementbyID("mauticform_input_gf_first_name").value=<? echo $first_name; ?>
document.getElementbyID("mauticform_gf_first_name").value