Want to get CF7 HTML table <td> input fields value on my email - contact-form-7

Want to get CF7 HTML table input fields value on my email but I can't understand how can I retrieve table values in my email.
here is my code
<div class="form-row">
<div class="column-full" align="center">
<h1>YOUR PROFILE</h1>
</div>
</div>
<div class="form-row">
<div class="column-full"
<table border="1" cellpadding="0">
<tr>
<td>For Registration Purpose</td>
<td><input type="text" size="30"/></td>
<td>Registration #</td>
<td><input type="text" size="30"/></td>
</tr>
<tr>
<td>Posted by </td>
<td><input type="text" size="30"/></td>
<td>CV ID # </td>
<td><input type="text" size="30"/></td>
</tr>
</table>
</div>
</div>
<div class="form-row">
<div class="column-half">
<h4>Name : </h4> [text* your-name]
</div>
<div class="column-half">
<h4>Father's Name : </h4> [text* father-name]
</div>
</div>

Looks like you're trying to build a grid layout form in cf7. html tables are notoriously unresponsive, so not a good practice to use them.
I would recommend you use the CF7 Smart Grid-layout extension plugin to build your grid form instead. It builds grid forms which are responsive by default.
Next, if you want to insert submitted values into the notification mails, you need to use cf7 tags rather than your own <input> fields. The cf7 plugin does not recognise custom html fields and that is the reason you don't see them as being available when setting up your mail.
So instead of <input type="text" name="your-text"/> you would use [text your-name] and let the cf7 plugin handle the creation of the html field.

Related

ColdFusion submitting a form

I have a form where an user can add new people to the list. I need it to only allow the form to update if the required fields are filled out.
My current code works in Chrome or FireFox, but not with with Safari. In Chrome and FireFox, it will not submit the form unless the fields are filled out. However, Safari allows the user to submit the form even if it is left blank.
Is there any other way to write the code to make it work with all three browsers? Below is just a little of the code for some of the required fields.
<cfform method="post" action="##" name="aForm" id="addClientForm" class="">
<input type="hidden" name="method" value="clientAdd">
<input type="hidden" name="datasource" value="<cfoutput>#request.dsn#</cfoutput>">
<input type="hidden" name="Active" value="1">
<div style="float:left;" class="formContent470">
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<th colspan="" style="text-align:left;">Add Client</th>
</tr>
<tr><cfoutput>
<td>
Contact
<span style="color:red">*</span>
<input type="Text" name="Contact" value="" required="Yes" message="Contact is required" maxLength="75" class="inputText430">
</td>
</tr>
<tr>
<td>
Client Name
<span style="color:red">*</span>
<input type="Text" name="ClientName" value="" required="Yes" message="Client Name is required" maxlength="75" class="inputText430">
</td>
</tr>
<tr>
<td>
Sounds to me like you're looking for server side validation. I would, of course, validate client side using Javascript and THEN back that up with server side.
Despite the well meaning advice avoid CFINPUT and CFFORM if you can (My opinion others may differ). You'll gain far greater flexibility/portability using a client side library like JQuery and sticking with plain Jane HTML form fields (steps off podium).
That being said, and assuming you'll stick with server side validation as a starting point, there's an "old school" CF method of form validation using hidden fields with specially formed name attributes. That should solve your problem. You can see this method described very well in the documentation.
-Cheers!

Submit form to another page within the same domain

How to submit form to another page within the same domain which has no form ID or name?
Form that needs to submit to another page:
<form id="login_form" action="roundcube" method="post">
<div class="input-req-login">
<label for="user">Email Address</label>
</div>
<div class="input-field-login icon username-container">
<input name="_user"
id="rcmloginuser"
autofocus="autofocus"
placeholder="Enter your email address."
class="std_textbox"
type="text"
tabindex="1" required>
</div>
<div style="margin-top:30px;" class="input-req-login">
<label for="pass">Parola</label>
</div>
<div class="input-field-login icon password-container">
<input name="_pass"
id="rcmloginpwd"
placeholder="Enter your email password."
class="std_textbox"
type="password"
tabindex="2" required>
</div>
<div class="controls">
<div class="login-btn">
<button type="submit"
onclick="document.getElementByName("form").submit()"
tabindex="3">Autentificare</button>
</div>
Target form:
<form name="form" action="./" method="post">
<input type="hidden" name="_token" value="543e98f5e6cc25841fc0df79cb939590">
<input type="hidden" name="_task" value="login">
<input type="hidden" name="_action" value="login">
<input type="hidden" name="_timezone" id="rcmlogintz" value="_default_">
<input type="hidden" name="_url" id="rcmloginurl" value="">
<table>
<tbody>
<tr>
<td class="title">
<label for="rcmloginuser">Utilizator</label>
</td>
<td class="input">
<input name="_user"
id="rcmloginuser"
size="40"
autocapitalize="off"
autocomplete="off"
type="text">
</td>
</tr>
<tr>
<td class="title">
<label for="rcmloginpwd">Parolă</label>
</td>
<td class="input">
<input name="_pass"
id="rcmloginpwd"
size="40"
autocapitalize="off"
autocomplete="off"
type="password">
</td>
</tr>
</tbody>
</table>
<p class="formbuttons">
<input type="submit"
class="button mainaction"
value="Autentificare" />
</p>
</form>
Ok, I have taken a look at your sites now. This is actually quite simple.
I guess what you are trying to do is to set up a personalized web site to log in so you can give your own look and feel. And roundcube, I guess that is a standard mail system you have installed?
Well the problem is that roundcube not only sends user name and password. If you look at the HTML code you also see:
<input type="hidden" name="_token" value="5b6a757df5eee91fa7ee7171466b8b2a">
<input type="hidden" name="_task" value="login">
<input type="hidden" name="_action" value="login">
<input type="hidden" name="_timezone" id="rcmlogintz" value="_default_">
<input type="hidden" name="_url" id="rcmloginurl" value="">
All these are hidden values that are automatically sent with the log in POST. You probably need to add the last 4 of them.
There might be a big problem for you though. The first one called _token I have a theory that this is a randomized string that the server will require you to provide. I can be wrong but if I am correct you will not be able to do what you want. The reason for having this random string is to prevent users from posting log ins from other forms (that is if I am correct)
Maybe it is possible for you to turn off this randomized string in the roundcube admin settings? If not I think you don't have an easy way to proceed unless you want to dig into the code of round cube.
Edit: I just tried submitting the original form without the _token and it does not work. so unfortunately you are out of luck this time.
I am not quite sure I understand your question, but I guess you are writing a new page and want to post to another page. What if you do like this?
<form id="login_form" action="http://webmail.mysite.com/roundcube/" method="post">

Internet Explorer form submit with target to iframe not working

I'm using the hidden iframe method of submitting files without loading a new page, and it works on every browser except Internet Explorer, which is strange coming from an otherwise top-notch browser.
The form and iframe look like this:
<iframe id="hidden_upload" style="display:none" src="" name="hidden_upload" ></iframe>
<form class="" action="upload.php" method="post" target="hidden_upload" enctype="multipart/form-data" id="uploadForm">
<table>
<tbody>
<tr>
<td><label for = "title">Title: </label></td>
<td><input type="text" name="title" id="title" maxlength="40" style="width:300px;"/></td>
</tr>
<tr>
<td><label for="description">Description: </label></td>
<td><textarea id="description" name="description" style="width:460px;height:135px;"></textarea></td>
</tr>
<tr>
<td><label for="file">File: </label></td>
<td><input type="hidden" name="MAX_FILE_SIZE" value="3145728" /><input id="file" type="file" name="file"/></td>
</tr>
</tbody>
</table>
<center><input type="submit" value="Upload" id="filesubmit" onclick="return submitting()"/></center>
</form>
I have another page that DOES work in IE, with no discernible differences in the doc type, or form and iframe structure.
It's also not the headers from the upload page because I tried setting the action of the working form to the upload page of the non-working one and it still worked in IE.
The function submitting is working an returns true.
edit:
For the sake of brevity, this isn't working either:
<form class="" action="upload.php" method="post" target="hidden_upload" enctype="multipart/form-data" id="importForm">
<input type="submit" />
</form>
<iframe id="hidden_upload" style="display:none" src="" name="hidden_upload" ></iframe>
edit: This is completely ridiculous. I copied the working page verbatim into the non-working page and it still didn't work. The ONLY difference was the directory, and the .htaccess files were identical.
I had this problem and after many attempts, it was solved only as explained here:
"http://terminalapp.net/submitting-a-form-with-target-set-to-a-script-generated-iframe-on-ie/"
basically, iframe needs to be created this way:
iframe = document.createElement('<iframe name="fileUploaderEmptyHole">');
I also found out frame names for current window are stored in window.frames. In IE11, the property .name is empty for all iframes in windows.frames :O
I manually fixed like:
for(i=0;i<window.frames.length;i++)
window.frames[i].name = window.frames[i].frameElement.name;
Then, you can get to frames using target name.

form get method not working in opera browser

Why forms submited using get method is not working in opera browser?
<form method="get" action="">
I am submiting to same page
<form method="get" action="">
<table class="search_form_table" width="428" cellpadding="0" cellspacing="0" border="0" >
<tr>
<td width="150">Order Number</td>
<td><input name="order_number" /></td>
</tr>
<tr>
<td>Start Date</td>
<td><input class="search_date_fields" name="date_from" /> End date : <input class="search_date_fields" name="date_to" /></td>
</tr>
<tr>
<td colspan="2" align="right"><input class="subimit_button search_button_width" type="submit" value="Submit" /></td>
</tr>
</table>
</form>
If this is the same problem I thought I had, it's not that GET doesn't work. It's because the browser hides the form name/value pairs in the query string in the Location bar. If you actually go to the location bar and hilite the URL that you submitted to, you'll see the form parameters in the query string. I hate this, but it is the way Opera does it. :-/
submitting GET forms certainly works in Opera. Copying this code to a file and submitting it creates exactly the same URL as in Chrome. Hence, your problem must be something else. Without more information it's impossible to tell what your problem really is.

IOS 5 - UIWebView duplicating requests to Rails server

I have a IOS 5 application that uses a Webview which shows some HTML received from the server.
The HTML has a form and a submit button.
The backend is a RoR 3 server.
When I click the submit button it is sending two duplicate requests to the server.
If I test the same HTML in a browser it does not send duplicate requests.
Any ideas? It is inserting two records in the DB. I want a good solution , not an unique index in the DB.
The HTML code of the page is very simple:
<html>
<body>
<div class="user_questions">
<form accept-charset="UTF-8" action="http://localhost:3000/questions/actions/sendQuestion" method="get">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓" />
</div>
<table>
<tr>
<td>
<a href="http://localhost:3000/questions/41/voteup?user_id=10&lesson_id=7&deviceName=iPhone&origin=user">
<img alt="Up" src="http://localhost:3000/assets/up.gif" />
</a>0
<a href="http://localhost:3000/questions/41/votedown?user_id=10&lesson_id=7&deviceName=iPhone&origin=user">
<img alt="Down" src="http://localhost:3000/assets/down.gif" />
</a>
</td>
<td>
Question 1
</td>
</tr>
<tr>
<td colspan="2">
<input id="userQuestion" name="userQuestion" type="text" />
</td>
<td>
<input name="commit" type="submit" value="Send" />
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
It is generated on the server and sent to the App via REST/Json, then setted to the webview using [webView loadHTMLString:htmlQuestions baseURL: nil];
Thanks