Modx css issue not pulling in styles on the form - php

I'm editing a site using Modx cms.
I'm trying to add a contact form to the contact page. I already have one in the sidebar specified in a template. The code on the contact page form points to the same div tags, but it isn't picking up any of the css.
any ideas why this is happening. Do I need some kind of plugin?
Thanks for all your help
Regards
Judi
<div class="enquiry-form-top">
<h2>Enquiry Form</h2>
</div>
<div class="enquiry-form">
<form class="enquiry" id="enquiry" action="mailer.php" method="post">
<fieldset>
<legend>Enquiry Form</legend>
<div class="form-field">
<label for="Name">Name:</label>
<input type="text" id="Name" name="Name" value="">
</div>
<input type="hidden" name="thankspage" value="thank-you.html">
<input type="hidden" name="subject" value="Enquiry Form">
<div class="form-field">
<label for="Address"> Address:</label>
<input type="text" id="Address" name="Address" value="">
<input type="text" id="Address2" name="Address2" value="">
<input type="text" id="Address3" name="Address3" value="">
</div>
<div class="form-field">
<label for="DOB">DOB:</label>
<input id="DOB" type="text" name="DOB" value="" />
</div>
<div class="form-field">
<label for="Total-Fund-Size">Total Fund Size:</label>
<input id="Total-Fund-Size" type="text" name="Total-Fund-Size" value="" />
</div>
<div class="form-field">
<label for="Number-Of-Funds">Number Of Funds:</label>
<input id="Number-Of-Funds" type="text" name="Number-Of-Funds" value="" />
</div>
<div class="form-field">
<label for="Lump-Sum-Benefit">Has Lump Sum <br/>Benefit Been Taken:</label>
<ul>
<li>Yes <input type="checkbox" name="Lump-Sum-Benefit" id="Lump-Sum-Benefit" value="Yes" /></li>
<li>No <input type="checkbox" name="Lump-Sum-Benefit" id="Lump-Sum-Benefit2" value="No" /></li>
</ul>
</div>
<div class="form-field">
<label for="Telephone-Number">Telephone Number:</label>
<input type="text" id="Telephone-Number" name="Telephone-Number" value="">
</div>
<div class="form-field">
<label for="Best-Time-To-Contact">Best Time To Contact:</label>
<input type="text" id="Best-Time-To-Contact" name="Best-Time-To-Contact" value="">
</div>
<div class="form-field">
<label for="Email">Email:</label>
<input type="text" id="Email" name="Email" value="">
</div>
<div class="form-field">
<img src="CaptchaSecurityImages.php" alt="">
<label for="security_code"> Security Code: </label>
<input type="text" id="security_code" name="security_code">
</div>
<div class="form-buttons">
<input type="image" name="Submit" value="Submit" src="images/annuity/submit_button.gif">
</div>
</fieldset>
</form>

There is no reason I can think of for this to happen, and you don't need any plug-ins.
Once the page is rendered it is of course just HTML and it doesn't matter if it was made in modx or any other system.
Can you investigate the page using Firebug and make sure the Stylesheet is loading?
Maybe the form that is working is enclosed in a div with a class and all the styles are set in the style sheet as follows (ie. Children of the containing div)
.enclosingdiv .form-field
That would explain why your form isn't picking up the styles.
Also you should check out eform (Package, wiki) it's great for simple contact forms.

Related

Form within a form in HTML?

I created an application form with HTML and on that application the user has to upload his resume. I was thinking to create a form within the form to let the user upload his resume such as:
<div class="application-form">
<form class="contact-form" action="application-form.php" method="post">
<div class="application-data">
<label>First Name</label>
<input type="text" name="first">
</div>
<div class="application-data">
<label>Last Name</label>
<input type="text" name="last">
</div>
<div class="application-data">
<label>Email</label>
<input type="email" name="email">
</div>
<div class="application-data">
<label>Phone Number</label>
<input type="phone" name="phone">
</div>
<div class="resume">
<form action="">
<label>Resume</label>
<input type="file" name="resume">
<button type="submit">Submit Resume</button>
</form>
</div>
</form>
</div>
Seems this is not possible in HTML. What is the best alternative? thanks
I don't see the need for the nested form here...just remove it and make the file upload part of the application-form.php handler. Also add the enctype attribute to your <form> to accept files.
<div class="application-form">
<form class="contact-form" action="application-form.php" method="post" enctype="multipart/form-data">
<div class="application-data">
<label>First Name</label>
<input type="text" name="first">
</div>
<div class="application-data">
<label>Last Name</label>
<input type="text" name="last">
</div>
<div class="application-data">
<label>Email</label>
<input type="email" name="email">
</div>
<div class="application-data">
<label>Phone Number</label>
<input type="phone" name="phone">
</div>
<div class="resume">
<label>Resume</label>
<input type="file" name="resume">
<button type="submit">Submit Resume</button>
</div>
</form>
</div>

Issue populating textarea with db data

So, like the title said, i'm having an issue while i'm populating a text area that is being used on HTML form, because it is not getting any content in it.
this is the form with the php while.
<?php
while ($row = mysqli_fetch_array($query))
{ echo '
<form action="insert/insertReport.php" id="newReport" method="post">
<div class="form-group">
<label for="clientRep">Cliente</label>
<br>
<input type="text" name="client" class="form-control" id="client" value="'.$row['client'].'">
</div>
<div class="form-group">
<label for="titleRep">Título do Relatório</label>
<br>
<input type="text" name="title" class="form-control" id="title" value="'.$row['title'].'">
</div>
<div class="form-group">
<label for="namefat">Data</label>
<br>
<input type="text" name="date" class="form-control" id="date" value="'.$row['date'].'">
</div>
<div class="form-group">
<label for="localRep">Local</label>
<br>
<input type="text" name="local" class="form-control" id="local" value="'.$row['local'].'">
</div>
<div class="form-group">
<label for="reportRep">Relatório</label>
<br>
<textarea rows="12" name="report" class="form-control" id="report" form="newReport" value="'.$row['report'].'"></textarea>
</div>
<input type="hidden" name="id" class="form-control" id="id" value="'.$row['id'].'">';
}?>
And this is the php query.
$sql = 'SELECT * FROM reports'
Does anyone know what's wrong with it?
Text area does not accept a value attribute. You place the contents between the textarea tags:
<textarea rows="12" name="report" class="form-control" id="report" form="newReport">'.$row['report'].'</textarea>

Text in first field shows as label for second field

How do we make a text field sync with another text field i.e Adding text in first field shows as label for another text field.Basically i have made a currency exchange skeleton.
<form method='POST' action='index.php'>
<div class="row uniform 50%">
<div class="6u 12u(mobilep)">
<input type="text" name="from" value="" placeholder="From Which Currency?" tabindex="1" />
<input type="hidden" name="owner" value="<?php echo $username; ?>" />
</div>
<div class="6u 12u(mobilep)">
<input type="text" name="to" value="" placeholder="To Which Currency?" tabindex="2" />
</div>
</div>
<div class="row uniform 50%">
<div class="6u 12u(mobilep)">
<input type="text" name="limit" value="" placeholder="How much volume?" tabindex="3" />
</div>
<div class="6u 12u(mobilep)">
<input type="text" name="fee" value="" placeholder="Your Fee or put Zero(Don't add %age sign)" tabindex="4" />
</div>
<div class="6u 12u(mobilep)">
<input type="text" name="price" value="" placeholder="Your Rate ( Don't add symbols)" tabindex="4" />
</div>
</div>
This is the result i currently see with this code: http://i.imgur.com/dWD3Nu5.png
But i want to make it like this: http://i.imgur.com/34BU8g3.png
Add text of your textbox to label on the keyUp event of that textbox itself.

html5 input date empty on post php

I'm using the HTML5 input date type. After posting, I see this input empty, and all the other inputs (HTML4 types) are OK.
What could be the reason?
This is my form:
<form action="/SGM/index.php?r=manager/addcoach_post" method="post">
<div class="registerFeildArea2">
<div class="registerTxtP2">Family name</div>
<div class="registerFeild">
<input name="lname" type="text" value="" size="" class="registerFeildValue" />
</div>
</div>
<div class="registerFeildArea">
<div class="registerTxtP2">First name</div>
<div class="registerFeild">
<input name="fname" type="text" value="" size="" class="registerFeildValue" />
</div>
</div>
<div class="registerFeildArea2">
<div class="registerTxtP2">Address</div>
<div class="registerFeild">
<input name="address" type="text" value="" size="" class="registerFeildValue" />
</div>
</div>
<div class="registerFeildArea">
<div class="registerTxtP2">City</div>
<div class="registerFeild">
<input name="city" type="text" value="" size="" class="registerFeildValue" />
</div>
</div>
<div class="registerFeildArea2">
<div class="registerTxtP2">Birthdate</div>
<div class="birthDayFeild">
<input name="bdate" id="meeting" type="date" value="2011-01-13"/>
</div>
</div>
<div class="AddBtn"><input name="Next" type="submit" value="הוסף" class="AddBtnValue" /></div>
</form>
And when I get to the actionAddcoach_post(), all the fields are OK except for the bdate.
What could be the reason?

Formmail Redirect Issue

I'm trying to get a Formmail form to re-direct back to it's own page. For example, if I'm on the page, http://www.rightfittech.com/paincenter/contact-us.html, I would like the re-direct to go back to http://www.rightfittech.com/paincenter/contact-us.html, which is the same page.
I searched Google like crazy, and no worthwhile results. The forums keep saying to create a hidden input field
BUT THIS IS NOT WORKING!!!
My code below, and note that I didn't modify formmail, except for email addresses!
<form action="http://www.rightfittech.com/paincenter/formmail.php" name="Contact" method="post"
id="form1">
<input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER" >
<input type="hidden" name="redirect" value="http://www.rightfittech.com/paincenter/contact-us.html"/>
<input type="hidden" name="recipients" value="robertmyrick#hotmail.com" >
<input type="hidden" name="mail_options" value="FromAddr=robertmyrick#hotmail.com" >
<input type="hidden" name="subject" value="New Contact" >
<div class="wrapper row-2">
<div class="col-1">
<div class="form">
<label>First Name:</label>
<input type="text" />
</div>
<div class="form">
<label>Last Name:</label>
<input type="text" />
</div>
<div class="form">
<label>E-mail:</label><br/>
<input type="text" />
</div>
<div class="form">
<label>Phone Number:</label>
<input type="text" />
</div>
</div>
<div class="col-2">
<div>
<label>Enter Your Message:</label>
<textarea cols="1" rows="1"></textarea>
</div>
<div class="wrapper">
<div class="alignright" style="float:left">
<em><b>Clear</b></em>
<div style="width:20px; float:left"> </div>
<em><b>Submit</b></em></div>
</div>
</form>
Try setting the value good_url instead of redirect.
Like so:
<input type="hidden" name="good_url"
value="http://www.rightfittech.com/paincenter/contact-us.html"/>

Categories