So when using the Contact Owner Module, the TO: Field is not used so i want to put a value in there and make it read only. The only problem is all the code is:
Quote:
<?= $sendmail_form ?>
I can change it to:
Quote:
<form id="g-contact-owner-send-form" method="post" action="/index.php/contactowner/sendemail/-1">
<input type="hidden" value="Some Random Numbers/Letters" name="csrf">
<fieldset>
<legend></legend>
<ul>
<li>
<label for="email_to">To:</label>
<input id="g-contactowner-to-name" class="textbox" type="text" value="Owner Name" name="email_to" readonly="readonly"(or even make it hidden)>
</li>
<li>
<label for="email_from">From:</label>
<input id="g-contactowner-from-email" class="textbox" type="text" value="Your email here." name="email_from">
</li>
<li>
<label for="email_subject">Subject:</label>
<input id="g-contactowner-subject" class="textbox" type="text" value="" name="email_subject">
</li>
<li>
<label for="email_body">Message:</label>
<textarea id="g-contactowner-email-body" class="textarea" cols="" rows="" name="email_body"></textarea>
</li>
<li>
<input class="submit ui-state-default ui-corner-all" type="submit" value="Send" name="SendMessage">
</li>
</ul>
</fieldset>
</form>
but then i have the token value up there. Is this necessary? can i just remove that input line all together? or is is need for cookies or something to make the email work. just trying to understand.
where can i find the default code for the sendmail_form, maybe that has my answer? i can take that, paste it in the contactowner_emailform.html.php file and be on my way. maybe some php that will generate the token?
Posts: 27300
I don't understand what you want to do here.
The default form is generated by the get_email_form function in /contollers/contactowner.php
do you want to disable the editing of one form field? if so just add:
->disabled(true);
If you need to csrf token it is :
$csrf = access::csrf_token();
and can be used like:
<?= $csrf ?>
Hope that helps.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 35
thank you for the reply.
The <?= $csrf ?> tag also worked to generate a random csrf (though i am not 100% sure what it's used for) but i didnt go that route.
I have added the ->disabled(true); in the contactowner.php file where the form is being built and that accomplishes what i wanted, cause regardless of what the visitor changed it to the email would always go to the Owner, so i thought it odd to allow that field to be editable. what is the -> called? i want to add an "onclick" event for the from email, but not sure how to research the onclick for this type of form building. (i.e. for the from email, ->onclick="this.value='';"
anyhow, i can modify the g-contactowner-to-name css to change it's appearance. (or add it cause i cent find it anywhere in the css files.)
Thanks again.
Posts: 27300
Not sure. It is part of the forge form generation of kohana.
You could add:
->id("someid")
to the field and then use jquery to listen for the click. Add the JS to the view file.
I do that in the admin form of the carousel module. Forge does not have radio buttons that I know so I use checkboxes and toggle the checkboxes with JS using the id of the form field.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 35
Thank you.
i was able to add:
getting it to execute that function, then to the .php file then in the view file added:
I added the if statement cause i only want it to clear on the first click, and on the first click that is the default value there.
Posts: 27300
Glad you got it all sorted and posted back to the community for others.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 16
Hi,
Is there a way to add Reply-to logic to the email that is sent out with via the Contact Owner email?
Please help.
Posts: 27300
I'm not sure I 100% understand what you are after and what 'logic' you need but see if this works:
Edit contactowner/controllers/contactowner.php find:
and change to:
Does that work? I did not test.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team