Jump to content

wallyson

Members
  • Posts

    28
  • Joined

  • Last visited

wallyson's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. in all honesty I did not want to argue, I was just explaining what I meant to say, but quickly jumped off it. All I want to do was help, but unfortunatly some people dont understand that.Flic gratz on your code woring, I know you feel good.
  2. flic, the code that scott100 provided will work just fine for checking the whole form. If you need more help check out the validation tutorial in the w3 area. Try to look at his code, and then mimic it with your style. If your doing something complicated his code may become of no use. Try google searching for a validation js file that can do it all: meaning if a particular field is not filled out, a red markup appears to show which one isnt. that sorta of thing. I see you got it work, no?
  3. What im saying is is that most business corporations who sell a product stick to traditional old standards so that people who have different types of browsers or older versions of browsers can still view the site. html 4.01 is being widely used in most corporations for this very reason.and most of the internet is business of some sort, so back to my statement: who cares if its not written in html vs xhtml.
  4. you dont need / for this to execute, the onClick event works just fine, and what does check() do implied that he shows me the JS hes using. I use alot of DOM for my complex websites, so im used to using this.form and such. As with the return, you are correct in YOUR example, but it doesnt always have to be there.People write different code. who cares about xhtml, I know citigroup, and amazon dont.
  5. Ok, get rid of the that return inside the onClick event.and i also check your code on the site, on the method=post part, there should be " " around postmethod="post" Maybe those will help, and another thing, what does that function check do?
  6. It may becuase there is no submit type and no method in there try this:<form name="myform" id="myform" method="get"><input type="text" name="mytext" id="mytext" /><input type="submit" value="enter text" onclick="showForm(this.form);"></form><script type="text/javascript"><!--function showForm(form1){for(var i=0; i<form1.length;i++){var text = document.getElementById('mytext').value;document.write(text);}}--></script> Ok, over kill a little bit, but I only added the loop incase you have multiple inputs like name, day, country.. so on. Anyways you submit the form with the onclick event to the function showForm. anyways the variable text will get the data (note: use IDs with every input, becuase its easier to get using Jscript) of mytext.Then it simply prints out.
  7. ahh I understand hahaha its easier to just use a div instead.<script type="text/javascript"> document.write('<div class="myclass">Portfolio</div>');</script> and ifyou wnated to get really technical, you could also use innerHTML (DOM) to save the data to a variable that you can pass around via div id in the html.
  8. Try doing the following: Get rid of the onSubmit, and do onClick on teh html submit button, and also do instead of this, do this.form.works for me on my form submits. And you dont really need the back slashes (/) at the end of the inputs.<div id="content"><h1>Email Us</h1><form name="contactform" method=post action="send.php"><p><label for="name" id="namel">Your name: *</label><input class="text" type="text" name="name" /></p><p><label for="email" id="emaill">Your email: *</label><input class="text" type="text" name="email" /></p><p><label for="tel" id="tell">Your phone number:</label><input class="text" type="text" name="tel" /></p><p><label for="ref" id="refl">Your reference:</label><input class="text" type="text" name="ref" /></p><p><label for="enq" id="enql">Your enquiry: *</label><textarea name="enq"></textarea></p><p> </p><p><input type="submit" value="Send Email" onClick="return check(this.form);"/></p></form></div>
  9. If you explain a little better, I know I can help you.
  10. The post above your post is using the innerHTML feature. which all the data is sent to the div ID. in the html page, simply have a div with the id= whatever the id was. and all the data should be displayed there.ps. how does the editer not recognize javascript DOM?
  11. Very nice, now you should add the page show.php with maybe a switch or somethin, to show how its gettin the data and then returning it.
  12. Ha I ended up figuring it out. I simply added in an ID in the two input fields.Then getElementById it. Thanks for helping me out though, your first post helped themost. hahahaWally
  13. OK here is what I have using DOM to create some multiple input boxes:<html><script>var annouceInputs = 1;////////////////////////////Creates new announcement //////////////////////////function addAnnounce(){ var table = document.getElementById('annoucementData'); var tr = document.createElement('TR'); var td2 = document.createElement('TD'); var td3 = document.createElement('TD'); var inp1 = document.createElement('INPUT'); //url for announcement var inp2 = document.createElement('INPUT'); //headline for announcement var breaks= document.createElement('br'); var inp3 = document.createElement('INPUT'); // delete "-" button var p1 = document.createElement('p'); var p2 = document.createElement('p'); var inp4 = document.createElement('INPUT'); var break2 = document.createElement('br'); if(annouceInputs>0) { var img = document.createElement('IMG'); inp3.setAttribute('type', 'button'); inp3.setAttribute('value', '-'); inp4.setAttribute('type', 'button'); inp4.setAttribute('value', '+'); p1.className='delete'; inp1.className= 'delete'; inp2.className= 'delete'; td3.appendChild(inp4); td3.appendChild(break2); inp3.onclick = function() { removeElement(tr); } inp4.onclick = function() { addAnnounce(); } td3.appendChild(inp3); } inp1.setAttribute("name", "announceUrl"+annouceInputs); inp1.setAttribute("value", "URL"+annouceInputs); inp2.setAttribute("Name", "annouceHeadline"+annouceInputs); inp2.setAttribute("value", "Headline"+annouceInputs); table.appendChild(tr); td2.style.paddingLeft = "50px"; tr.appendChild(td2); tr.appendChild(td3); td2.appendChild(inp1); td2.appendChild(breaks); td2.appendChild(inp2); annouceInputs++;}////////////////////////////////Removes the new Child element//////////////////////////////function removeElement(tr){ tr.parentNode.removeChild(tr);}</script><body onload="addAnnounce();" > <br /><br /><FORM NAME="myform" ACTION="#" METHOD="GET"><table> <tr> <th><p>Email Generator</p></th> </tr> <tr> <td style="padding-left: 50px;"> <input class="delete" type="text" name="date" value="Date"> </td> </tr> <tr> <th align="left"><p>Announcements</p></th> <td valign="top"> <input type="button" value="+" onClick="addAnnounce();"> </td> </tr> <tr> <tbody id="annoucementData" valign="top" border="1"> </tbody> </tr></table></FORM></body></html> Ok you can pretty much copy and paste that into a temp page, and view what it does.I got it to do what I want, but now Im having trouble actually collecting the data.How do I get the data from the multiple input boxes now that I have created them?Please help.Wally
  14. Hello, I am trying to create multiple input boxes in sets of 2 (one is for url, and the other for headline).Now the tricky part is that, There is a "+" button and a "-" button. If a user clicks on the "+" a new set of input boxes appear. and if they user clicks the "-" they input boxes go away.How do I do this in Jscript. Ill show a little of my code. var cfields= new Array();var x = 0;function showFields(){ var divID= 'results'; var output=''; output+= '<div style="border: 1px solid; width: 151px;padding: 3px;" id="announcements"><input type="text" value="URL"><br>'+ '<input type="text" value="Headline"></div>'; output+=''; document.getElementById(divID).innerHTML = output;}///////////////////////////////////////////////////////////////////////////////function newField(){var foo = new showFields();cfields.push(foo);alert(cfields);x++;}</script><body> <!--<a href="#" onClick="showFields();">Click here</a><a href="#" onClick="newField();">new Field</a>--><br /><br /><table> <tr> <th><p>Email Generator</p></th> </tr> <tr> <td> <div style="border: 1px solid; width: 151px;padding: 3px;"><input type="text" value="Date"></div> </td> </tr> <tr> <th align="left"><p>Announcements</p></th> </tr> <tr> <td> <div style="border: 1px solid; width: 151px;padding: 3px;" id="announcements'+x+'"><input type="text" value="URL"><br> <input type="text" value="Headline"></div> <div id="results"></div> </td> <td valign="top"> <div style="border: 1px solid; width: px;padding: 3px;" align="center"><input type="button" value="+" onClick="showFields();"><br> <input type="button" value="-"></div> </td> </tr> <tr> <th align="left"><p>Press Release</p></th> </tr> <tr> <td> <div style="border: 1px solid; width: 151px;padding: 3px;" id="announcements'+x+'"><input type="text" value="URL"><br> <input type="text" value="Headline"></div> </td> <td valign="top"> <div style="border: 1px solid; width: px;padding: 3px;" align="center"><input type="button" value="+"><br> <input type="button" value="-"></div> </td> </tr> <tr> <th align="left"><p>In the Press</p></th> </tr> <tr> <td> <div style="border: 1px solid; width: 151px;padding: 3px;" id="announcements'+x+'"><input type="text" value="URL"><br> <input type="text" value="Headline"></div> </td> <td valign="top"> <div style="border: 1px solid; width: px;padding: 3px;" align="center"><input type="button" value="+"><br> <input type="button" value="-"></div> </td> </tr> <tr> <th align="left"><p>Point of View</p></th> </tr> <tr> <td> <div style="border: 1px solid; width: 151px;padding: 3px;" id="announcements'+x+'"><input type="text" value="URL"><br> <input type="text" value="Headline"></div> </td> <td valign="top"> <div style="border: 1px solid; width: px;padding: 3px;" align="center"><input type="button" value="+"><br> <input type="button" value="-"></div> </td> </tr> <tr> <th align="left"><p>World Online</p></th> </tr> <tr> <td> <div style="border: 1px solid; width: 151px;padding: 3px;" id="announcements'+x+'"><input type="text" value="URL"><br> <input type="text" value="Headline"></div> </td> <td valign="top"> <div style="border: 1px solid; width: px;padding: 3px;" align="center"><input type="button" value="+"><br> <input type="button" value="-"></div> </td> </tr></table></body></html> I tryed to make an array and stuff a new set in the array. Im sure this is not how its done.If anybody could help I would appreciate it.Thanks,Wally
  15. Hey man, Thanks for the help! I actually got it all to work now. I used javascript algo to fix my duplicate problem, and I also used the bubble sort to sort it by day (1, 2, 3 ....) You were very helpful.Again thanks much,Wally
×
×
  • Create New...