SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Form repeated with (javascript) innerHTML is not being posted.

    The elements that are repeated with innerHTML of javascript are not being posted in PHP.
    Code:
    function CreateForm(fm){
    		var str = "";
    		var str_1 = "";
    		str = "<select name=\"cmbDays[]\" id=\"cmbDay[]\"><option value=\"1\" selected=\"selected\">Sunday</option><option value=\"2\">Monday</option>";
    			str += "<option value=\"3\">Tuesday</option><option value=\"4\">Wednesday</option><option value=\"5\">Thursday</option><option value=\"6\">Friday</option>";
    			str += "<option value=\"7\">Saturday</option></select>";
    			str += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hour : <input name=\"housrs[]\" type=\"text\" id=\"housr[]\" value=\"00\" size=\"4\" /> ";
    			str += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Minute : <input name=\"minutess[]\" type=\"text\" id=\"minutes[]\" value=\"00\" size=\"4\" />";
    		
    		if(fm.prg_times.value != "" && fm.prg_times.value != 0){
    			for(i = 0; i < fm.prg_times.value; i++){
    				str_1 += "<br>" + str;
    			}
    		}
    		else{
    			str_1 = str;
    		}
    		document.getElementById('ScheduleForm').innerHTML = str_1;
    But the minutess[] and hours[] are not being posted. Does anyone have idea about it? Neither i can see these form elements in view source too.

    That means i want to create some extra form text boxes dynamically with some events.

    Can anyone find the solution please?

    With Regards
    Raju Gautam
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes Kravvitz. Thank you for the reply. I am trying to use the DOM to create dynamic form elements. I will create text box and append in the form. But how can place those text boxes in the proper place?

    Can you help me out on this matter please.

    Thank you very much in advance.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  4. #4
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Learn how to use the DOM to find the elements you want. The childNodes[] collection of elements and the getElementsByTagName() method are very helpful.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •