hopefully that makes sense.... basically I have a form and want to take the input for the "email" field and truncate/trim the value before the "@" symbol and give that value to another hidden field.
EDIT/ADDED: Also, if possible in the same function, it would be great to automatically generate and append a random number (between 01 and 99 would suffice) to ensure there are no "duplicates/matching "hiddenfield" values... for example if the email address is something nondescript like info@blahblah.com, where "info" might be blocked if already in system but info46 and info07 would be fine.
IF it is not appropriate to add to the question like this I apologize and will edit it out, mark the question as answered based on original criteria and open a new question that hopefully can add to this.
So basically if someone entered "JohnSmith@hotmail.com", "JohnSmith26" (as an example) would be assigned as the value for another hidden form field.
example:
<label>Email Address:</label><input type="text" id="email" name="email" value="" size="30" maxlength="80"/>
<input type="hidden" id="hiddenfield" name="hiddenfield" value="truncated email" />
I saw this thread but am not using coldfusion etc and am hoping to just find a simple way to do similar within the form: how do I trim an email input address so only the data before the @ is inputted into the database?
am looking for the best way using javascript/jQuery to assign the truncated value to the other field.