Jump to content

steveclondon

Members
  • Posts

    161
  • Joined

  • Last visited

    Never

Everything posted by steveclondon

  1. HI, I have a form that is dynamically generated. I have no problem with the form that works fine, but now I want to check if a user has filled out the information. A small piece of code is here when the form is made. while (i<something) { heightInput.setAttribute("id",""); heightInput.id="itemHeight_"+i; heightInput.setAttribute("name",""); heightInput.name="itemHeight_"+i; i++; } so now I have names for my input fields of itemHeight_0, itemHeight_1 and so on. I now want to check these when they are submitted, I have tried this below but of course it is not seeing itemName_+a; as the fieldname. I could pull all the elements by tag and then go through the array checking these, but I have other text boxes on the form that that would be difficult. Anyone got any ideas? I don't know how many of these text boxes will be generated so I need an automated approach. a=0; while(a<numberItems) { //the form has already been got by element id and stored as theForm. var setName='itemName_'+a; alert(setName); if (theForm.setName.value=='') { alert('name not set'); hasError=true; sError += " Please xxx.\n"; } a++; } // while Edit/Delete Message
  2. use a hidden frame to provide a get method to a hidden script, then output the information back into javascript from the hidden frame into the parent document.
  3. HI, I want to have a select box with a number in it, when the user selects the number, then that many sets of form boxes will appear with in the form. So as an example if each set consisted of 4 text boxes and one select box then when the user selects 2 in the main box 2 sets of these will be generated. This needs to work in all browsers of course. Anyone got any ideas of the best way to go about this.
  4. i would have a temp cart that once the user orders it will move the contents to the real cart where your order is saved. then daily automate a script to go in and delete all in the temp cart that is over a day old. this way you can keep your database down. if you try and do this using javascript there are to many reasons why it won't work.
  5. arn't you pulling it out the database using the code above? You will need to display alot more information for any one to get what exactly you have done and what you want to do!
  6. think you will need to provide more information, what error message did you get? the code you use? how you stored the name?
  7. you have a , just before your where command. When you do this you should do the following: result=mysql_query($sql) or die(mysql_error()); do that on every query then if there is an error it will tell you the problem.
  8. Hi I have to values in a form and want to check if one is lower than the other. see below my details, please do not worry about theForm bit that will get the element by Id further up. I have alerted both values and they are fine so as an example I sent theBid at 100 and then theLowestBid at 50 and it does not work, if I swap them around and have a < instead it always displays the same results no matter what the values are? any ideas because its not meant to work like this? var theBid=theForm.bid.value; var theLowestBid=theForm.lowestBid.value; if (theBid>theLowestBid) { alert('the bid is not above the lowest bid'); }
  9. Yes you have collected $_POST['message'], but where have you collected $_POST['thradid']
  10. Yea it is possible, you can look on google so you can encode your php files, however this does slow things down. Personally I don't worry about it, it is unlikely that will ever happen.
  11. I see your post[''] above but where does it pass the threadid or topic id. You will need to collect these by post. topicID=$_POST['topicID']; as an example
  12. personally I would store the date info as follows yyyymmddhhmmss in the database as a 14 num int, then query the database. Substitute dates below with the dates you want. $query="SELECT * FROM database WHERE visitor_date>'yyyymmddhhmmss' && vistor_date<'yyyymmddhhmmss'; $result=mysql_query($query); $rows=mysql_num_rows($result); $rows will give the number between those times, you can also pull them out then and loop through them.
  13. Use a loop eg while (myInfo=mysql_fetch_array($result) { echo $myInfo['NameOfYourFieldHere']; }
  14. I'm an idiot, didn't realise that I have align right on the second select box. All sorted now.
  15. Yea I think I will have to play around with splitting the table with 2 tds, although I did try this and it still did the same thing which was really wierd. Will have a play around with it again.
  16. add a referal id to the member table, so if member 200 had added 100 users, those users would all have 200 in there referal id. Then had the ip etc in the member table
  17. god that looks like one complex bit of code to do a really simple thing
  18. would help to know what was on line 39, and whats in the includes like login.php. Check you are not echoing information out to the browser before you are setting cookies.
  19. you need to really to this with a database, when you upload get the file name of the image and store this in the database.
  20. you need a to work with a payment gateway and use there API. Paypal is one option for credit card payments and can be used in several ways so the user wouldn't leave your site (only available if you are in the US).
  21. Hi, I am putting a couple of select boxes in a cell on a table, on firefox it displays fine one box after the other, on ie 7 it puts the second box after the text. Any ideas? Example of the code below, you can see here that you have at: then another box, but ie 7 doesn't put it like that. I have tried a valign in the <td> but it didn't help. <td> Your advert will expire on: <input name="dateAdvert" id="dateAdvert" type="text" disabled="true" size="14" maxlength="22" readonly="true"> at: <select name="advertTime" id="advertTime" class="FormField" align="right"> <option value=" " selected>Expiry Time</option> </select> </td>
  22. I have a future date in the following format yyyymmddhhmmss, I want to take away todays date from this, then display the number of days, mins, seconds as a count down. I can covert date date format and add extra days etc to get new dates as shown below adding one day. This is using a $date array that has split the date format into each part. $setDate=date("Ymdhis", mktime($date['hour'], $date['mins'], $date['seconds'], $date['monthNumber'], $date['day']+1, $date['year']));
  23. im using firefox at the moment, and would want this to work in ie firefox and the other browsers. The bit of code that splits the date down only returns the current date, it is not adding any days on. The code below does two alerts, the first is the full date and time which does show the days added (this is fine, but I don't want the time to be displayed, just the date). The other alert below will display just the date, however it will not show the future date with the extra days added, it will only show todays date. Looking at the code, I can't see why that is? var oneMinute = 60 * 1000 ; // milliseconds in a minute var oneHour = oneMinute * 60; var oneDay = oneHour * 24; var oneWeek = oneDay * 7; //check first that it is a number number=formPlaceAdvert.advertDays.value; var today = new Date(); var dateInMS = today.getTime() + oneDay * number; var targetDate = new Date(dateInMS); alert(targetDate);//this way shows todays date and time + 3 days var oneMinute = 60 * 1000 ; // milliseconds in a minute var oneHour = oneMinute * 60; var oneDay = oneHour * 24; var oneWeek = oneDay * 7; //check first that it is a number var today = new Date(); var dateInMS = today.getTime() + oneDay * number; var targetDate = new Date(dateInMS); targetDate=Date(dateInMS); var getDate = targetDate.split(" "); var yr = today.getFullYear(); alert(""+getDate[0]+" "+getDate[1]+" "+getDate[2]+" "+yr+""); //(this one just shows todays date, not the extra three days that need to be added.)
  24. did that, have just seen that it still comes up with todays date. Without the split it will add on three days, with the split it has todays date. Any ideas?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.