Search Results

Search found 19528 results on 782 pages for 'form factor'.

Page 22/782 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Jquery - Setting form select-field "selected" value only works after refresh

    - by frequent
    Hi, I want to use a form select-field for users to select their country of residence, which shows the IP based country as default value (plus the IP address next to it); Location info (ipinfodb.com) is working. I'm passing "country" and "ip" to the function, which should modify select-field and ip adress Problem: IP adress works, but the select-field only updates after I hit refresh. Can someone tell me why? Here is the code: HTML <select name="setup_changeCountry" id="setup_changeCountry"> <option value="AL-Albania">Albanien</option> <option value="AD-Andorra">Andorra</option> <option value="AM-Armenia">Armenien</option> <option value="AU-Australia">Australien</option> ... </select> <div class="setup_IPInfo"> <span>Your IP</span> <span class="ipAdress"> -- ip --</span> </div> Javascript/Jquery function morph(country,ip) >> passed from function, called on DOMContentLoaded { var ipAdress = ip; $('.ipAdress').text(ipAdress); var countryForm = country; $('#setup_changeCountry option').each(function() { if ($(this).val().substr(0,2) == countryForm) { $(this).attr('selected', "true"); } }); } Thanks for any clues on how to fix this. Frequent

    Read the article

  • PHP email form multiple select

    - by Justin Goodman
    I'm trying to set up a simple PHP contact form for a website and I need some help modifying the PHP to list multiple items from a select menu and would appreciate the help. I'm a graphic designer, not a developer, so a lot of this is way over my head. This is the problem area here: <label for="Events[]">Which Event(s) Will You Be Attending?</label> <div class="input-bg"> <select name="Events[]" size="6" multiple="MULTIPLE" class="required" id="Events[]"> <option value="Wednesday">Portfolio Show June 16</option> <option value="Thursday">Portfolio Show June 17</option> <option value="Saturday">Graduation Ceremony</option> <option value="Saturday Eve">Graduation Party</option> <option value="Not Sure">Not Sure</option> <option value="Not Coming">Not Coming</option> </select> </div> And here's the PHP: <?php // CHANGE THE VARIABLES BELOW $EmailFrom = "[email protected]"; $EmailTo = "[email protected]"; $Subject = "Graduation RSVP"; $Name = Trim(stripslashes($_POST['Name'])); $Email = Trim(stripslashes($_POST['Email'])); $Guests = Trim(stripslashes($_POST['Guests'])); $Events = Trim(stripslashes($_POST['Events'])); // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Guests: "; $Body .= $Guests; $Body .= "\n"; $Body .= "Events: "; $Body .= $Events; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page // CHANGE THE URL BELOW TO YOUR "THANK YOU" PAGE if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=http://justgooddesign.net/graduation\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=http://justgooddesign.net/graduation/error.html\">"; } ?> Any help really is appreciated!

    Read the article

  • Help with javascript form validation

    - by zac
    I am getting a headache with form validation and hoping that the kind folks here can give me a hand finishing this sucker up I have it basically working except the email validation is very simplistic (only alerts if it is blank but does not actually check it if is a valid email address) and I am relying on ugly alerts but would like to have it reveal a hidden error div instead of the alert. I have this all wrapped up with an age validation check too.. here are the important bits, minus the cookie scripts function checkAge() { valid = true; if ( document.emailForm.email.value== 0 ) { alert ( "Please enter your email." ); valid = false; } if ( document.emailForm.year.selectedIndex == 0 ) { alert ( "Please select your Age." ); valid = false; } var min_age = 13; var year = parseInt(document.forms["emailForm"]["year"].value); var month = parseInt(document.forms["emailForm"]["month"].value) - 1; var day = parseInt(document.forms["emailForm"]["day"].value); var theirDate = new Date((year + min_age), month, day); var today = new Date; if ( (today.getTime() - theirDate.getTime()) < 0) { var el = document.getElementById('emailBox'); if(el){ el.className += el.className ? ' youngOne' : 'youngOne'; } document.getElementById('emailBox').innerHTML = "<img src=\"emailSorry.gif\">" createCookie('age','not13',0) return false; } else { //this part doesnt work either document.getElementById('emailBox').innerHTML = "<img src=\"Success.gif\">" createCookie('age','over13',0) return valid; }; }; var x = readCookie('age'); window.onload=function(){ if (x=='null') { }; if (x=='over13') { }; if (x=='not13') { document.getElementById('emailBox').innerHTML = "<img src=\"emailSorry.gif\">"; }; } can someone please help me figure a better email validation for this bit: if ( document.emailForm.email.value== 0 ) { alert ( "Please enter your email." ); valid = false; } and how would I replace the alert with something that changes a class from hidden to visible? Something like? document.getElementById('emailError').style.display='block'

    Read the article

  • MDI WinForm application and duplicate child form memory leak

    - by Steve
    This is a WinForm MDI application problem (.net framework 3.0). It will be described in C#. Sorry it is a bit long because I try to make things as clear as possible. I have a MDI application. At some point I find that one MDI child form is never released. There is a menu that creates the MDI child form and show it. When the MDI child form is closed, it is supposed to be destroyed and the memory taken by it should be given back to .net. But to my surprise, this is not true. All the MDI child form instances are kept in memory. This is obviously a "memory leak". Well, it is not a real leak in .net. It is just that I think the closed form should be dead but somehow there is at least one unknown reference from outside world that still connect with the closed form. I read some articles on the Web. Some says that when the MDI child form is closing, I should unwire all the event handlers, otherwise some event handlers may keep my form alive. Some says that DataBindings should be cleaned before the form is closing otherwise the DataBindings will add references to some global Hashtable and thus keep my form alive. My form contains quite a lot things. Many event handlers and many DataBindings and many BindingSources and few suspected controls containing user control and HelpProvider. I create a big method that unwires all the event handlers from all the relevant controls, clear all the DataBindings and DataSources. The HelpProvider and user controls are disposed carefully. At the end, I find that, I don't have to clear DataBindings and DataSources. Event handlers are definitely causing the problem. And MDI form structure also contributes to something. During my experiments, I find that, if you create a MDI child form, even if you close it, there will still be one instance in the memory. The reference is from PropertyStore of the main form. This means, unless the main form is closed (application ends), there will always be one instance of MDI child form in the memory. The good news is that, no matter how many times you open and close the child form, there will be only one instance, not a big "leak". When it comes to event handlers, things become more tricky. I have to address that, all the event handlers on my form are anonymous event handlers. Here is an example code: //On MDI child form's design code... Button btnSave = new Button(); btnSave.Click += new System.EventHandler(btnSave_Click); Where btnSave_Click is also a method in MDI child form. The above is always the case for various controls and various types of event. To me, this is a bi-directional circular reference. btnSave keeps a reference of MDI child form via the event handler. MDI child form keeps a reference of btnSave instance. To me again, such bi-directional circular reference should not cause any problem for .net's garbage collector. This means that I do not have to explicitly unwire the event when the form is being disposed: btnSave.Click -= btnSave_Click; But the truth is not so. For some event handlers, they are safe. Ignoring them do not cause any duplicate instance. For some other event handlers, they will cause one instance remaining in the memory (similar effect as the MDI form structure, but this time caused by the hanging event handlers). For some other event handlers, they will cause every instance opened in the memory. I am totally confused about the differences between these three types of event handlers. The controls are created in the same way and the event is attached in the same way. What is the difference? (Don't tell me it is the event handle methods that make difference.) Anyone has experience of this wired scenario and has an answer for me? Thanks a lot. So now, for safety issue, I will have to unwire all the event handlers when the form is being disposed. That will be a long list of similar code for each control. Is there a general way of removing events from controls in recursive way using reflection? What about performance issue? That's the end of my story and I am still in the middle of my problem. For any help, I thank you.

    Read the article

  • Getting my string value from my form into my class( not another form)

    - by jovany
    Hello all, I have a question regarding the some data which is being transfered from one form to my class. It's not going quite the way i'd like to , so I figured maybe there is someone who could help me. This is my code in my class Public Class DrawableTextBox Inherits Drawable Dim i_testString As Integer Private s_InsertLabel As String Private drawFont As Font Public Sub New(ByVal fore_color As Color, ByVal fill_color As Color, Optional ByVal line_width As Integer = 0, Optional ByVal new_x1 As Integer = 0, Optional ByVal new_y1 As Integer = 0, Optional ByVal new_x2 As Integer = 1, Optional ByVal new_y2 As Integer = 1) MyBase.New(fore_color, fill_color, line_width) X1 = new_x1 Y1 = new_y1 X2 = new_x2 Y2 = new_y2 Trace.WriteLine(s_InsertLabel) End Sub Friend WriteOnly Property _textBox() As String Set(ByVal Value As String) s_InsertLabel = Value Trace.WriteLine(s_InsertLabel) End Set End Property ' Draw the object on this Graphics surface. Public Overrides Sub Draw(ByVal gr As System.Drawing.Graphics) ' Make a Rectangle representing this rectangle. Dim rect As Rectangle = GetBounds() ' Fill the rectangle as usual. Dim fill_brush As New SolidBrush(FillColor) gr.FillRectangle(fill_brush, rect) fill_brush.Dispose() ' See if we're selected. If IsSelected Then ' Draw the rectangle highlighted. Dim highlight_pen As New Pen(Color.Yellow, LineWidth) gr.DrawRectangle(highlight_pen, rect) highlight_pen.Dispose() ' Draw grab handles. Trace.WriteLine("drawing the lines for my textbox") DrawGrabHandle(gr, X1, Y1) DrawGrabHandle(gr, X1, Y2) DrawGrabHandle(gr, X2, Y2) DrawGrabHandle(gr, X2, Y1) Else 'TextBox() Dim fg_pen As New Pen(Color.Red, LineWidth) 'Dim fontSize As Single = 0.1 + ((Y2 - Y1) / 2) Dim fontSize As Single = 20 Try Dim drawFont As New Font("Arial", fontSize, FontStyle.Bold) Trace.WriteLine(s_InsertLabel) gr.DrawString(s_InsertLabel, drawFont, Brushes.Brown, X1, Y1) Catch ex As ArgumentException End Try gr.DrawRectangle(Pens.Azure, rect) ' gr.DrawRectangle(fg_pen, rect) fg_pen.Dispose() End If End Sub Public Function GetValueString(ByVal ValueType As String) Return ValueType End Function ' Return the object's bounding rectangle. Public Overrides Function GetBounds() As System.Drawing.Rectangle Return New Rectangle( _ Min(X1, X2), _ Min(Y1, Y2), _ Abs(100), _ Abs(30)) Trace.WriteLine("don't forget to make variables in GetBounds DrawableTextbox") End Function ' Return True if this point is on the object. Public Overrides Function IsAt(ByVal x As Integer, ByVal y As Integer) As Boolean Return (x >= Min(X1, X2)) AndAlso _ (x <= Max(X1, X2)) AndAlso _ (y >= Min(Y1, Y2)) AndAlso _ (y <= Max(Y1, Y2)) End Function ' Move the second point. Public Overrides Sub NewPoint(ByVal x As Integer, ByVal y As Integer) X2 = x Y2 = y End Sub ' Return True if the object is empty (e.g. a zero-length line). Public Overrides Function IsEmpty() As Boolean Return (X1 = X2) AndAlso (Y1 = Y2) End Function End Class I've got a form with a textbox( form1) in which the text is being inserted and passed through a buttonclick (al via properties). As you can see I've placed several traces and in the property of the class my trace works fine , however if I look in my Draw function it is already gone. And I get a blank trace. Does anyone know what's happening here. thanks in advance. (forgive me I'm new )

    Read the article

  • What is the pro and cons using javascript in our form ?

    - by justjoe
    I got this code in my submit form Then use some js functions in the head; function frmSubmitSameWindows() { form.target = ''; form.submit(); } function frmSubmitNewWindows() { form.target = '_blank'; form.submit(); } What is the pro and cons when we use javascript event function such as frmSubmitSameWin() and frmSubmitNewWin() in our form ? as far as i concern, this is the best solution when we need a way to submit things. Is there other preference ? the better way then the way i got now ?

    Read the article

  • Wicket : Can a Panel or Component react on a form submit without any boilerplate code?

    - by MRalwasser
    I am currently evaluating Wicket and I am trying to figure out how things work. I have a question regarding form submit and panels (or other components). Imagine a custom wicket panel which contains a text field, doing as-you-type validation using ajax. This panel is added to a form. How can the Panel react a form submit (let's say because javascript/ajax is unavailable)? I am currently only aware of one solution: calling a panel's method inside the Form onSubmit() method. But this seems not like a "reusable" approach here, because I have to add boilerplate code to every form's onSubmit() which contains the panel (and every developer which use the panel must know this). So here comes my question: Is there any way that a Panel/Component can "detect" a form submit in some way? Or is there any other solution beside this? Thank you.

    Read the article

  • Using JS to POST a form in an iframe.

    - by Stavros Korokithakis
    I would like to POST a form in an iframe, generated like so: My JS loads an iframe inside the page, adds a form to the iframe and submits the form. What I would like to happen is the iframe to load the result of that request. So, I would effectively like to post a form and render the result inside the iframe, without touching the parent (apart from putting the iframe up for display in the first place). I am using the code from this answer: http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit/134003#134003 but I can't get it to not reload the parent. I post the form, and instead of the iframe refreshing, the entire parent refreshes. I don't know why that is, since the url it's posting to is different and would at least redirect there. Can anyone help me with this problem? I just want a post inside an iframe and only within the iframe, basically.

    Read the article

  • Form.ShowDialog() does not show form.

    - by clawson
    I've come across a situation where I try to run a simple line of code in a method Dim res As DialogResult = frmOptions.ShowDialog() but nothing happens. The dialog box will not appear. If I run this method from another location in the code it executes fine (i.e. displays the form in dialog mode and code executes fine thereafter). Hence, it may be the way in which I arrive at this code that is causing my problem, but I cannot see to find what is wrong. When I pause the debugger the line of code is highlighted in green but I can't see to step over it or into it. Any idea what may cause this to happen, or what I should be looking for that might be causing the problem?? Thanks for the help!

    Read the article

  • rails - form to disply non-input type fields in nested form

    - by nktokyo
    Hi, I guess this is a newbie question, but what is the syntax in a form to show contents of fields not as a text box/area, but rather like label would appear. <% form_for @user do |f| %> <% f.fields_for :user_ingreds do |builder| %> <p> <%= builder.??? %> </p> <% end %> <% end%> user has many user_ingreds and accepts_nested_attributes for user_ingreds. Basically I want to make a list of user_ingreds where the user can't edit the data but can remove the record from the list via a button - however the fields_for builder doesn't recognize a direct call to to the fields in user_ingreds model (ie, builder.user_id throws and error.

    Read the article

  • using zend form decorators

    - by pradeep
    <div class="field50Pct"> <div class="fieldItemLabel"> <label for='First Name'>First Name:</label> </div> <div class="fieldItemValue"> <input type="text" id="firstname" name="firstname" value="" /> </div> </div> <div class="clear"></div> I want the code to appear like this in source code . how do i write the same thing in zend using decorators ? The element is like $firstname = new Zend_Form_Element_Text('FirstName'); $firstname->setLabel('FirstName') ->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addErrorMessage('Error in First Name') ->addValidator('NotEmpty');

    Read the article

  • jQuery form check - iframe content check empty

    - by Henry
    Please check out the comment field at the bottom on http://tinyurl.com/3xow97t in Firefox - it works pretty well - the red warning gets added if empty and the submit gets disabled - once there is text inside, the submit gets re-enabled. the problem i have now, it does not work in IE. i really hope somebody can help. the iframe contents checks are inside: modules/editor/scripts/global.js

    Read the article

  • IE 8 Compatibility Mode Causes Form Submit Button to Wrap

    - by Robert
    The below code does what I want in browsers I check with except IE when using compatibility mode. In compatibility mode the submit (Remove) button wraps to the next line. Can anyone help? It should look like it does in Firefox or IE when not using compatibility mode. Can't use float:left/right because I cannot specify length beforehand. Thanks for any help. Name: Test Name That is Longer Than The Other Qty: 1 Name: Short Test Name Qty: 1

    Read the article

  • Form generator and data capture PHP application

    - by Tom
    Hi, Does anyone know of a PHP open source which can generate forms to be deployed across your website. These forms will collect and aggregate the data with in on database. There should also be the functionality to search across the forms (to generate reports and newsletter mailing lists) All the services I have found so far have been hosted solutions. Thanks Tom

    Read the article

  • VB.NET dynamic use of form controls

    - by Marcx
    I have 10 labels named lbl1, lbl2, ... lbl10 I'd like to change their propriety (using a cicle) with the cicle index for i as integer=1 to 10 step 1 lbl (i) = PROPRETY 'I know this is wrong but it's what I would do... end for I'm using a workaround, but I'm looking for a better way.. Dim exm(10) As Label exm(1)=lbl1 exm(2)=lbl2 ... exm(10)=lbl10 for i as integer=1 to 10 step 1 exm (i) = PROPRETY end for

    Read the article

  • Django - Override admin site's login form

    - by TrojanCentaur
    I'm currently trying to override the default form used in Django 1.4 when logging in to the admin site (my site uses an additional 'token' field required for users who opt in to Two Factor Authentication, and is mandatory for site staff). Django's default form does not support what I need. Currently, I've got a file in my templates/ directory called templates/admin/login.html, which seems to be correctly overriding the template used with the one I use throughout the rest of my site. The contents of the file are simply as below: # admin/login.html: {% extends "login.html" %} The actual login form is as below: # login.html: {% load url from future %}<!DOCTYPE html> <html> <head> <title>Please log in</title> </head> <body> <div id="loginform"> <form method="post" action="{% url 'id.views.auth' %}"> {% csrf_token %} <input type="hidden" name="next" value="{{ next }}" /> {{ form.username.label_tag }}<br/> {{ form.username }}<br/> {{ form.password.label_tag }}<br/> {{ form.password }}<br/> {{ form.token.label_tag }}<br/> {{ form.token }}<br/> <input type="submit" value="Log In" /> </form> </div> </body> </html> My issue is that the form provided works perfectly fine when accessed using my normal login URLs because I supply my own AuthenticationForm as the form to display, but through the Django Admin login route, Django likes to supply it's own form to this template and thus only the username and password fields render. Is there any way I can make this work, or is this something I am just better off 'hard coding' the HTML fields into the form for?

    Read the article

  • Extracting [] elements from form collection - mvc - should use icollection but have mix of types

    - by bergin
    hi there. have looked at Phil Haacks project on books at http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx which has been useful, but I have a mix of data types. I use a modelview so that i can have a mix of objects, in this case: Order (ie order.id, order.date etc), Customer, SoilSamplingOrder and a list of SoilSamplingSubJobs which is like this [0].id, [0].field, [1].id, [1].field etc Perhaps I should be using ICollection instead of List? I had problems getting UpdateModel to work so I used an extract from collection method. the first 4 method calls : orderRepository.FindOrder(id); etc give the model the original to be edited. but after this point i'm a little lost in how to update the subjobs. I hope i have delineated enough to make sense of the problem. [HttpPost] public ActionResult Edit(int id, FormCollection collection) { Order order = orderRepository.FindOrder(id); Customer cust = orderRepository.FindCustomer(order.customer_id); IList<SoilSamplingSubJob> sssj = orderRepository.FindSubOrders(id); SoilSamplingOrder sso = orderRepository.FindSoilSampleOrder(id); try { UpdateModel(order, collection.ToValueProvider()); UpdateModel(cust, collection.ToValueProvider()); UpdateModel(sso, collection.ToValueProvider()); IList<SoilSamplingSubJob> sssjs = orderRepository.extractSSSJ(collection); foreach (var sj in sssjs) UpdateModel(sso, collection.ToValueProvider()); orderRepository.Save(); return RedirectToAction("Details", new { id=order.order_id}); } catch { return View(); } }

    Read the article

  • ui.datepicker.js form validation

    - by lena
    Hi, I'm using ui.datepicker.js and I want to validate the date field to make sure the user select a date. I have tried function allow_submit() { var f = document.all.frm; if (f.date.value == "") { jAlert("Please select a date"); return false; } //if return true; } and also have try if (f.date.value == "0000-00-00") { without succes Any clue?

    Read the article

  • fb:request-form in iframe redirects away from facebook

    - by IkimashoZ
    I have an <fb:requestform> in an iFrame Facebook app. I have set target="_parent", so that the callback will target the parent iFrame and not itself, which seems to work as expected. But, instead of my desired file loading, I get redirected to my server. Checking the response of the requestform's POST in Firebug revealed this: <script type="text/javascript"> top.location.href = "http://www.facebook.com/login.php?api_key=***&v=1.0&req_perms=&next=http%3A%2F%2F***"; </script> I have already had this same problem when sending jQuery AJAX requests to update various elements in an iFrame. I solved the problem by making sure my headers contain P3P: CP="CAO PSA OUR". That is indeed set for this call as well (can be seen clearly in Firebug), but I still get redirected to facebook.com/login.php.

    Read the article

  • PHP Regex to remove nested form elements but not input elements

    - by that0n3guy
    I'm modifying a PHP script that I have and it is currently outputting a nested form. Something like: <form name="input" action="html_form_action.asp" method="get"> <p>stuff here here, this may or may not be in a div, script, etc..</p> <form name="input" action="html_form_action.asp" method="get"> <div>stuff here possibilly</div> Username: <input type="text" name="user" /> <input type="submit" value="Submit" /> </form> <p>otherstuff this may or may not be in a div, script, etc..</p> </form> Nested form's are a no-no (IE hates them and basically causes the form to stop working), so I need to remove the nested form lines, but not the form items. I need to remove the nested: <form name="input" action="html_form_action.asp" method="get"> and </form> but not the outer <form and </form> or the input or submit stuff. Is this possible to do with regex? Note, the reason I just want to regex out the form rather than find the problem is because I know it will take some significant re-working to get rid of the double form... the regex solution is quick for now.

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >