Jump to content

steveclondon

Members
  • Posts

    161
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

steveclondon's Achievements

Member

Member (2/5)

0

Reputation

  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.
×
×
  • 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.