This question is locked. New answers and comments are not allowed.
Hi.
we´ve got a problem with the window-control.
We have a view with a Form containing a Textbox "Name1".
The form contains a window with a Textbox "Name2" and a Button with JavaScript attached to submit the form.
The Window itself has no additional Form.
When Debugging the Action-method, the Textbox-Value for "Name2" in the window will not be submitted.
We need to submit both values.
The Code looks like this:
@Using Html.BeginForm()
@<input type="text" name="Name1" id"Name1" />
@<button type="submit" Id="feedback-open-button" >Submit feedback!</button>
Html.Telerik.Window.Name("Window") _
.Title("Submit feedback") _
.Content(Function(c)
@<input type="text" name="Name2" id"Name2" />
@<button id="LocationButton" class="t-button t-state-default">Submit feedback...</button>
Return c
End Function) _
.Width(400) _
.Draggable(True) _
.Modal(True) _
.Visible(False) _
.Render()
End Using
@code
Dim script As String = String.Empty
script &= "$('#feedback-open-button').click(" & vbCrLf
script &= "function(e)" & vbCrLf
script &= "{" & vbCrLf
script &= "e.preventDefault(); " & vbCrLf
script &= "$('#Window').data('tWindow').center().open(); " & vbCrLf
script &= "}); " & vbCrLf
script &= "$('#LocationButton').click(function(e) {" & vbCrLf
script &= " document.forms[0].submit(); " & vbCrLf
script &= "$('#feedback-form').closest('.t-window').data('tWindow').close();" & vbCrLf
script &= "});"
Html.Telerik.ScriptRegistrar().OnDocumentReady(script)
End Code
we´ve got a problem with the window-control.
We have a view with a Form containing a Textbox "Name1".
The form contains a window with a Textbox "Name2" and a Button with JavaScript attached to submit the form.
The Window itself has no additional Form.
When Debugging the Action-method, the Textbox-Value for "Name2" in the window will not be submitted.
We need to submit both values.
The Code looks like this:
@Using Html.BeginForm()
@<input type="text" name="Name1" id"Name1" />
@<button type="submit" Id="feedback-open-button" >Submit feedback!</button>
Html.Telerik.Window.Name("Window") _
.Title("Submit feedback") _
.Content(Function(c)
@<input type="text" name="Name2" id"Name2" />
@<button id="LocationButton" class="t-button t-state-default">Submit feedback...</button>
Return c
End Function) _
.Width(400) _
.Draggable(True) _
.Modal(True) _
.Visible(False) _
.Render()
End Using
@code
Dim script As String = String.Empty
script &= "$('#feedback-open-button').click(" & vbCrLf
script &= "function(e)" & vbCrLf
script &= "{" & vbCrLf
script &= "e.preventDefault(); " & vbCrLf
script &= "$('#Window').data('tWindow').center().open(); " & vbCrLf
script &= "}); " & vbCrLf
script &= "$('#LocationButton').click(function(e) {" & vbCrLf
script &= " document.forms[0].submit(); " & vbCrLf
script &= "$('#feedback-form').closest('.t-window').data('tWindow').close();" & vbCrLf
script &= "});"
Html.Telerik.ScriptRegistrar().OnDocumentReady(script)
End Code