Jump to content

sunziun

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by sunziun

  1. Hi thescientist, $gdate is a custom field from Advanced Custom Fields Plugin. It's date field which should display Gregorian date like 15/03/2014. $currentdate should grab the date of example 25/04/2014. And what I want is: If $gdate is equal to $currentdate then display "Today". Otherwise display the standard data from the loop. This is somehow not working properly or it displays just the normal loop. I have even tried to use $currentdate->setDate(2014,04,25) for testing purpose.
  2. Hi Justsomeguy, thanks for your reply. Actually nothing happens or it displays just the future posts. I might be missing some bits but I don't know what. Maybe it help you to understand more if access the website at hijamadays.com
  3. I have a list of 'post_status'' => 'future' which are published at certain dates throughout the year. These posts are custom posts whith Advanced Custom Fields. Since a couple of days I'm trying to display "Today" of published posts (for that particular day). The word "Today" should only display if date of the post equals the current date otherwise the the scheduled posts should be displayed. The query which looks like this display future posts: $future= new WP_Query(array( 'post_type' => 'hijama_days', 'date' => date('d/m/Y'), 'posts_per_page' => 1, 'order' => 'ASC', 'post_status' => 'future',)); The loop looks like this: while ( $future->have_posts() ) : $future->the_post();// next line is from Advanced Custom Field Docs$gdate = DateTime::createFromFormat('Ymd', get_field('gregorian_date')); I've tried this to display "Today" when the current event has been pusblished for that day: $currentdate = new DateTime();<p>When is the next event date?</p><?php if( $gdate->format('d/m/Y') == $currentdate->format('d/m/Y') ){ ?> <h1>Today</h1><?php } else { ?> <h1><?php echo $gdate->format('l') . ' '; the_title(); ?></h1><?php } ?> <h4>Gregorian: <?php echo $gdate->format('d/m/Y'); ?></h4> Somehow I cannot figure why is not working for me. Please help me out here.
  4. Hopefully someone can help me solve with this "easy" problem! I'm looking for a way to populate data in a Contact Form 7 (WordPress) from session. The session will be started by clicking on a book now button like this: <?php session_start(); if(isset($_GET['bookingdate'])) { $_SESSION['started'] = true;}?><a href="?bookingdate"> Book now </a> After clicking the button and the session is started I want to redirect to the form "booking " page and populate one of the fields with the booking date. The visitor will fill the rest of the form and submits. After submission the session will be destroyed. Would that be possible when using Contact Form 7 and WordPress?
  5. another option would be <button href="http://yourwebsite.com">Your Button Name</button> BTW this is HTML5 button tag!
  6. Hi, you could try this plugin for your gallery, compatible with all browsers :)And its free!
  7. Hi, you could check on grids like 960 Grids then click on "Custom CSS Generator". With a grid you can create table like divs!
  8. I like W3SCHOOLS

  9. [ SOLVED ] Hi everyone, thanks for your hints and supports. I got it working by just adding an onChange tag to the input field. <label>Destination House Number & Postcode</label><input type="text" id="postCode" name="postCode" onChange="EasyGo()" value="" required /> Javascript now listens to the events and I can capture all user inputs.
  10. This is the live code now and its still not working, which means I'm not getting the value entered by the user: <label>Destination House Number & Postcode</label><input type="text" id="postCode" name="postCode" value="" required />// Destination postcodevar pcode = document.getElementById('postCode').value// PayPal Item Namedocument.getElementById('item').value = "Dest: " + pcode + ", Week: " + week + ", Load: " + loading + ", Add. Hours: " + chours
  11. Hi, if I set the input field like this: <input type="text" id="postCode" placeholder="example: 25-NW23ED" value="Test postCode" required /> then I get the required results. But this is only if I preset the value. I don't to preset the value. I need the user to enter the postcode in this field and javascript should catch the entered values. This var pcode = document.getElementById('postCode').value catches only preset values. Many thanks for any suggestions!
  12. Hi, here is the live link: http://easygoremovals.co.uk/book_now/
  13. Hi, thanks Deirdre's Dad. This typos occurred just now while I was writing this post (already amended).So I think there is something else wrong.
  14. Hi, I got a form which I use to take payments via PayPal. All is setup but one form field. To write the "item_name" for PayPal i use this piece of code: document.getElementById('item').value = "Week: " + week + ", Load: " + loading + ", Add. Hours: " + chours + ", Dest: " + postcode Selection fields are: week, loading and chours postcode is an input field, type text I want to get the postcode entered by the user into the item field and use it as the item_name for PayPal. I tried pcode = document.getElementById('postcode') postcode =pcode.value postcode = document.FormName.ElementName.value and more other suggestions form the internet, but none is working.postcode is always empty or undefined form field is: <input type="text" id="postcode" name="postcode" required /> Please someone help me out!
  15. Hello everyone, I've an application which uses xml form for data entry. I was wondering if is possible to make calculation (mainly additions and subtraction)? <?xml version="1.0"?><items><item type="settings" position="label-top"/> <item type="label" label="Edit report details here." /> <item type="label" label="Date"/><item type="calendar" dateformat="%d/%m/%Y" validate="notEmpty" required="true" name="date" bind="date" label="Date" offsetLeft="15"/><item type="input" name="admin" bind="admin" label="Admin" offsetLeft="15"/> <item type="label" label="Sales"/> <item type="input" name="others" bind="others" label="Others" offsetLeft="15"/><item type="input" name="internet" bind="internet" label="Internet" offsetLeft="15"/><item type="input" name="topup" bind="topup" label="Top Up" offsetLeft="15"/><item type="input" name="phcard" bind="phcard" label="Phone Cards" offsetLeft="15"/><item type="input" name="phcalls" bind="phcalls" label="Phone Calls" offsetLeft="15"/> <item type="input" name="bustickets" bind="bustickets" label="Bus Tickets" offsetLeft="15"/> <item type="input" readonly="true" name="totalin" bind="totalin" label="Total In" offsetLeft="15"/> <item type="label" label="Expenses & Goods"/> <item type="input" name="expenses" bind="expenses" label="Expenses" offsetLeft="15"/><item type="input" name="goods" bind="goods" label="Goods" offsetLeft="15"/><item type="input" name="goodsdetails" bind="goodsdetails" label="Goods Details" offsetLeft="15"/><item type="input" readonly="true" name="balance" bind="balance" label="Balance" offsetLeft="15"/><item type="input" name="till" bind="till" label="Till" offsetLeft="15"/><item type="input" name="cash" bind="cash" label="Cash" offsetLeft="15"/><item type="input" name="debits" bind="debits" label="Debits" offsetLeft="15"/> <item type="input" readonly="tru" name="extra_short" bind="extra_short" label="Extra/Short" offsetLeft="15"/> <item type="button" xcommand="save" value="Submit" offsetTop="15"/> <item type="label" label="" offsetTop="15"/></items> What do you guys think?
  16. its working now, a dollar sign was missing at name='$name' to get the name from the address bar!
  17. I had this code $name=$_GET['name']; $query=mysql_query("SELECT * FROM $templates_table WHERE name='$name'"); the dollar sign was missing at name='$name' and that's why it didn't work. thanks anyways!
  18. Hello everyone, I've a table which looks like this: id | name | description1 | some name | some descriptions. Now, I want based on the name to be able to select the description from the database. Would that be possible? Thanks for your time.
  19. Sorry but I don't how to use this. please give me comprehensible example. thanks anyways.
  20. I am sorry but I don't get you. can you give examples?
  21. I would like disable the whole drop down called "one" by using onChange() <select id="one" onChange="disDropDown()"><option value="yes">Yes</option><option value="no">No</option></select> I would like to use the value, not value property!
  22. Hello very one, I've this peace of code which I cannot make it work. please some one help me with this <script type="text/javascript"> function disDropDown(){if(document.getElementById("one").value === "yes"){document.getElementById("two").disable='true'} else{document.getElementById("two").disable='false'}}</script> <form><select id="one"><option value="yes">Yes</option><option value="no">No</option></select> <select id="two"><option value="1">1</option><option value="2">2</option></select></form>
  23. Thank you So Called and birbal, The suggestion of So Called was good! that was the hint I was looking for. It worked perfect and I've added the missing peace.I needed the first option to be 0 in the value and start from the second value with 0.12 <select name="pot"><option value="0" selected="selected">1</option><?php for($p=1; $p<=4; $p++){ ?><option value="<?php echo $p*0.12 ?>"><?php echo $p+1 ?></option><?php } ?></select> having done this I get what I wanted!
  24. Hello everyone.There is a small problem with a drop-down form field I am trying to get work. I've this peace of code: <select name="pot"> <option value="0" selected="selected">1</option> <?php for($p=0.12; $p<=5; $p++){ ?> <option value="<?php echo $p ?>"></option> <?php } ?> </select> and what I get is this: <select name="pot"> <option value="0" selected="selected">1</option> <option value="0.12"></option> <option value="1.12"></option> <option value="2.12"></option> <option value="3.12"></option> <option value="4.12"></option> </select> but it should be like this: <select name="pot"> <option value="0" selected="selected">1</option> <option value="0.12">2</option> <option value="0.24">3</option> <option value="0.36">4</option> <option value="0.48">5</option> <option value="0.60">6</option> </select> please notice, first option is selected and it's value is 0.
×
×
  • Create New...