I have the following input field:
{assign var="name" value="test12345.example.com"}
<input name="domain" value="{$domain}" size="50"
data-hostname-check="{$options}"
placeholder="<?php echo substr(md5(mt_rand()), 0, 7); ?>"
onchange="if (
typeof simulateCart == 'function' && this.checkValidity())
simulateCart.call(this);"/>
What i need is to generate a random string for if the input field when its not filled. But I have no clue how to do this. This input field is in an if loop using smarty template.
The onchange is required at the moment so if I remove this you can leave the input field blank but there should be a label before we can insert it into the database
At the moment I have a var (static) whichh i can use for the placeholder text. The echo which i tried does not work. Maybe someone can help me fixing this. If i put this in the placeholder the whole text in the "" will be displayed.
Another issue is that the form has an input validation and you have to press on a button. I know there is an jQuery on.click how can i use this in my situation.