Is there any way to call a URL action within a <h:commandButton>, or for that matter a <h:form>? I'm trying to bypass my email's login page from my own website, so I'm using JSF beans to hold my login info in <h:inputSecret> tags so that I can simply click "Go to Email" and because I'm logged in to my own website, I could go straight to my inbox w/o logging in again
Just use plain HTML <form> instead of JSF <h:form>.
<form action="http://example.com/mail" method="post">
<input type="text" name="username" value="#{bean.username}" />
<input type="password" name="password" value="#{bean.password}" />
<input type="submit" value="Go to Email" />
</form>
Related
I'm trying to use formspree.io but for some reason is returning the following error:
Make sure you open this page through a web server, Formspree will not work in >pages browsed as HTML files. Also make sure that you're posting to >https://formspree.io/test#yopmail.com.
For geeks: could not find the "Referrer" header.
My code is the following:
<form action="https://formspree.io/test1#yopmail.com" method="POST" target="_blank">
<input type="text" id="name" name="name" placeholder="*First Name">
<input type="text" id="lastname" name="lastname" placeholder="*Last Name">
<textarea id="subject" name="subject" placeholder="*Your Message" style="height:200px"></textarea>
<input type="submit" value="Submit">
</form>
Please notice that I have the s in the "https://fo..." and I also have in my head tag the following:
<meta name="referrer" content="origin">
Thanks for any help.
I have set a basic mail form in TYPO3 but it doesn't seem to be working.
The installation of TYPO3 I am working on has several sites on it and other existing forms work just fine and don't appear to have any major differences to this new one that doesn't.
When the submit button is clicked the page adds ?tx_form_form[action]=process&cHash=xxx... to the url and does not send any mail or go to redirect page.
This form appears on the home page, and identical form on an internal page works fine...
Anyone know what might be the problem here?
Generated Form Code:
<form enctype="multipart/form-data" method="post" name="id-23" id="field-23" action="http://example.com/?tx_form_form[action]=process&cHash=b34b10df4ff74dac67960e990e130408">
<div>
<input type="hidden" name="tx_form_form[__referrer][#extension]" value="Form" />
<input type="hidden" name="tx_form_form[__referrer][#vendor]" value="TYPO3\CMS" />
<input type="hidden" name="tx_form_form[__referrer][#controller]" value="Frontend" />
<input type="hidden" name="tx_form_form[__referrer][#action]" value="show" />
<input type="hidden" name="tx_form_form[__referrer][arguments]" value="YToxOntzOjU6Im1vZGVsIjthOjA6e319a4f0ce18ed8a7ca3ab5be6c9bc69bc141296c7da" />
<input type="hidden" name="tx_form_form[__trustedProperties]" value="a:1:{s:7:"tx_form";a:5:{s:10:"first_name";i:1;s:9:"last_name";i:1;s:5:"email";i:1;s:8:"postcode";i:1;i:6;i:1;}}bbd972ea3852e6c16fab76a45b46929ac7ab0d52" />
</div>
<ol>
<li class="csc-form-24 csc-form-element csc-form-element-textline">
<label for="field-24">
</label>
<input placeholder="First Name" id="field-24" type="text" name="tx_form_form[tx_form][first_name]" required="required" />
</li>
<li class="csc-form-25 csc-form-element csc-form-element-textline">
<label for="field-25">
</label>
<input placeholder="Last Name" id="field-25" type="text" name="tx_form_form[tx_form][last_name]" required="required" />
</li>
<li class="csc-form-26 csc-form-element csc-form-element-textline">
<label for="field-26">
</label>
<input placeholder="Email" id="field-26" type="text" name="tx_form_form[tx_form][email]" required="required" />
</li>
<li class="csc-form-27 csc-form-element csc-form-element-textline">
<label for="field-27">
</label>
<input placeholder="Postal Code" class="signup-sml" id="field-27" type="text" name="tx_form_form[tx_form][postcode]" />
</li>
<li class="csc-form-28 csc-form-element csc-form-element-submit">
<label for="field-28">
</label>
<input type="submit" id="field-28" value="Submit" name="tx_form_form[tx_form][6]" />
</li>
</ol>
</form>
I don't know if it's related but all that extra spacing in the code has been showing up since upgrading the TYPO3 version...
I had a similar issue with a form not being functional in one website and perfectly OK in another.
Setup: TYPO3 7.6 installation with two websites, each with its own domain, both using the builtin system extension form and the extension realurl.
Issue: Within the first website all forms were functional, within the second submitting the form only resulted in the page being reloaded without any validation or action.
Solution:
(1) Make sure that both websites' starting pages are marked as "Root Page" and that both have domain records defined.
(2) Having realurl setup with automatic configuration, I forced an update by deleting the "realurl_autoconf.php" in the "typo3conf" folder.
(3) Make sure that both websites have the correct realurl configuration within their templates' typoscript setup, e.g.:
config {
prefixLocalAnchors = all
absRefPrefix = http://www.domain.tld/
absRelPath = /
tx_realurl_enable = 1
}
In my case I'd simply forgotten the www in the absRefPrefix for the second website...
Am using SEO URls to load my pages ie http://www.mywebsite.com/p/page1/100 but am having a problem with my search form. When I click submit, instead of the entire url changing to the stated one in the form, it just appends the variables to the url eg http://www.mywebsite.com/p/page1/100?p=search&q=Any+Query+String+here.
My question is, how do I replace the entire URL with the form variable instead?
Here is my form code:
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="get">
<input type="text" onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;" name="q" value="Search" />
<input type="hidden" value="search" name="p" />
<input type="submit" value="Search" class="submit" />
</form>
OK I solved it using a hack I think???
Apparently if I append a variable to the action url, this will force the browser to load the new url instead of append the form variable to the existing url.
Eg.
<form action="<?php $_SERVER['PHP_SELF'] ?>?p=search" method="get">
<input type="text" onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;" name="q" value="Search" />
<input type="hidden" value="search" name="p" />
<input type="submit" value="Search" class="submit" />
</form>
This worked for me but I dunno if it's the right way to achieve this or it's a hack.
I have the following simple form:
<form id="MyForm" action="../webformmailer.php" method="post" >
<input type="hidden" name="subject" value="Submission" />
<input type="hidden" name="redirect" value="../sandbox/123/thanks.html" />
<input type="text" size="20" name="FirstName" />
<input type="text" size="20" name="LastName" />
<input type="text" size="20" name="email" />
<select name="comment">
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
<input type="submit" name="submit" value="submit"/>
</form>
I am redirecting users to a simple 'thanks.html' page after they submit their information. This works well in all browsers except IE 8, which redirects users to the webformmailer.php or the action of the form.
Can anyone point me in the right direction?
Thanks
Inside your action script, process the request and then redirect to thanks.html:
header('Location: ../sandbox/123/thanks.html');
Update: since you don't have control over the action script, and all other browsers work exception IE8, then the problem must be in the way IE8 sends data to the server. Try set enctype="application/x-www-form-urlencoded" and see if it works.
I'm making a login form, but I don't want browser to be able to save username & password combination.
Just like PayPal or banks.
I have heard that I could do this by using AJAX & Javascript but I'm so unfamiliar with them, so I need to ask help from you!
<form id="loginform">
<label for="username">Username</label>
<input name="username" type="text" value="" required="required" />
<label for="password">Password</label>
<input name="password" type="password" value="" required="required" />
<input type="button" name="doLogin" value="Login" onclick="login(this.form.username.value,this.form.password.value);" />`
With that login form the browser doesn't ask to save the login combo... but now I just need to know how to send the login info to PHP :P
I am assuming that you require the prevention of things like autoformer (for Firefox). Simply change the names of the various input values to something that is different each time the user loads the form.
As Sunny's link suggest, you can use the autocomplete attribute to prevent the browser from suggesting input for a field. So for your example:
<form id="loginform">
<label for="username">Username</label>
<input name="username" type="text" value="" required="required" autocomplete="off"/>
<label for="password">Password</label>
<input name="password" type="password" value="" required="required" autocomplete="off" />
<input type="button" name="doLogin" value="Login" onclick="login(this.form.username.value,this.form.password.value);" />