Click here to Skip to main content
15,912,493 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionCan someone please help me with a code about a YAHTZEE game ( without using any objects) ???? Pin
Member 1132460720-Dec-14 0:52
Member 1132460720-Dec-14 0:52 
SuggestionRe: Can someone please help me with a code about a YAHTZEE game ( without using any objects) ???? Pin
Richard MacCutchan20-Dec-14 1:47
mveRichard MacCutchan20-Dec-14 1:47 
QuestionConcatenating two fields using javascript? Pin
samflex19-Dec-14 8:35
samflex19-Dec-14 8:35 
AnswerRe: Concatenating two fields using javascript? Pin
Graham Breach19-Dec-14 21:55
Graham Breach19-Dec-14 21:55 
GeneralRe: Concatenating two fields using javascript? Pin
samflex20-Dec-14 1:27
samflex20-Dec-14 1:27 
GeneralRe: Concatenating two fields using javascript? Pin
Tushar sangani20-Dec-14 1:32
professionalTushar sangani20-Dec-14 1:32 
QuestionjQuery bgiframe.js error: "jQuery error: JavaScript runtime error: Unable to get property 'msie' of undefined or null reference" Pin
Stephen Holdorf15-Dec-14 23:41
Stephen Holdorf15-Dec-14 23:41 
AnswerRe: jQuery bgiframe.js error: "jQuery error: JavaScript runtime error: Unable to get property 'msie' of undefined or null reference" Pin
Stephen Holdorf16-Dec-14 7:03
Stephen Holdorf16-Dec-14 7:03 
Questionjavascript slider Pin
Member 112981529-Dec-14 5:25
Member 112981529-Dec-14 5:25 
AnswerRe: javascript slider Pin
Richard MacCutchan9-Dec-14 6:15
mveRichard MacCutchan9-Dec-14 6:15 
QuestionRe: javascript slider Pin
ZurdoDev15-Dec-14 3:08
professionalZurdoDev15-Dec-14 3:08 
Questionweird issue in simple class declaration Pin
akhilonly0078-Dec-14 5:24
akhilonly0078-Dec-14 5:24 
AnswerRe: weird issue in simple class declaration Pin
Richard Deeming9-Dec-14 2:19
mveRichard Deeming9-Dec-14 2:19 
Questionsum two button values added in the inputbox using jquery Pin
Member 112879875-Dec-14 1:16
Member 112879875-Dec-14 1:16 
AnswerRe: sum two button values added in the inputbox using jquery Pin
Richard MacCutchan5-Dec-14 3:15
mveRichard MacCutchan5-Dec-14 3:15 
AnswerRe: sum two button values added in the inputbox using jquery Pin
ZurdoDev5-Dec-14 4:01
professionalZurdoDev5-Dec-14 4:01 
Questionhow to bind data to infragistics webhierarchicaldatagrid through javascript im having data in datatable i need to bind this dt to webhierarchicaldatagrid Pin
code project member4-Dec-14 19:01
code project member4-Dec-14 19:01 
QuestionRe: how to bind data to infragistics webhierarchicaldatagrid through javascript im having data in datatable i need to bind this dt to webhierarchicaldatagrid Pin
ZurdoDev5-Dec-14 4:01
professionalZurdoDev5-Dec-14 4:01 
Questionpostback issue when using dynamically created datetimepicker using javascript Pin
Dhyanga4-Dec-14 5:04
Dhyanga4-Dec-14 5:04 
Hi,

I am using dynamic datetimepicker that the user can add to any number. But I am having postback problem. Once I submit it, the return page should have all the submitted values including those added dynamic datetimepicker. Right now when i submit and when the page returns, all other static controls with data are there but no dynamically added datetimepicker controls.

Below is the code I used to add datatimepicker dynamically using javascript:

C#
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>


<link rel="stylesheet" media="all" type="text/css" href="jquery-ui.css" />
<link rel="stylesheet" media="all" type="text/css" href="jquery-ui-timepicker-addon.css" />
<script type="text/javascript" src="jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="jquery-ui-sliderAccess.js"></script>
<script type="text/javascript">
    $(function () {
      
         var counter = 1;
          jQuery("#<%= btnD1Add.ClientID %>").click(function (event) {
            event.preventDefault(); //this code is added to prevent the default submit functionality of the button

            jQuery("<li>").appendTo(".Date1More");
            jQuery("<label id='lblD1StartTime" + counter + "'>StartTime:</label><input type='text' id='txtD1StartTime"  +counter + "' name='txtStartTime1'/>").timepicker({
                hourGrid: 10,
                minuteGrid: 10,
                timeFormat: 'hh:mm tt'
            }).appendTo(".Date1More");
            
            counter++;
        });
    });
</script>
       <asp:Button ID="btnD1Add" runat="server" Text="Add more time slots" />
       

               <li>
                    <ul class="Date1More">
                                          
                </ul>
               </li>
</html>


Now how to use postback for these controls? I had tried to use following code in code but didn't work. I even tried it using !Ispostback() function under pageLoad but no effect.


C#
protected string[] txtStartTime1;
   protected void Page_Load(object sender, EventArgs e)
        {
            
           
            txtStartTime1 = Request.Form.GetValues("txtStartTime1");
        }
protected void Page_Init(object sender, EventArgs e)
        {
            try
            {
                if (txtStartTime1.Length > 0)
                {
                    TextBox txtStTime1 = new TextBox();
                    txtStTime1.ID = "txtD1StartTime";
                    txtStTime1.CssClass = "timepicker";
                    this.Controls.Add(txtStTime1);

                }
              
            }
            catch(Exception ex){}

        }


Is there any another way to do it?

Please help..
Dhyanga

AnswerRe: postback issue when using dynamically created datetimepicker using javascript Pin
Anurag Gandhi4-Dec-14 18:11
professionalAnurag Gandhi4-Dec-14 18:11 
AnswerRe: postback issue when using dynamically created datetimepicker using javascript Pin
Dhyanga5-Dec-14 5:11
Dhyanga5-Dec-14 5:11 
GeneralRe: postback issue when using dynamically created datetimepicker using javascript Pin
Anurag Gandhi5-Dec-14 5:29
professionalAnurag Gandhi5-Dec-14 5:29 
QuestionTranslation UserScript Pin
Kyudos3-Dec-14 11:20
Kyudos3-Dec-14 11:20 
AnswerRe: Translation UserScript Pin
Garth J Lancaster3-Dec-14 12:45
professionalGarth J Lancaster3-Dec-14 12:45 
GeneralRe: Translation UserScript Pin
Kyudos3-Dec-14 13:39
Kyudos3-Dec-14 13:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.