Search Results

Search found 6055 results on 243 pages for 'forms'.

Page 76/243 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • ERB doesnt get executed in javascript scripts

    - by Stefano
    Hi guys I have a select input on my page. this select input displays/hides fields in the form. This all works fine. But the problem is that if i submit the form and lack some necessary fields, it doesnt set the select to the right value afterwards. I just cant get the embedded ruby to work! it keeps escaping the whole thing... here my code: $(document).ready(function() { $("#profile_sex").val('<%= @profile.sex %>') $("#profile_sex").change(function(){ ($(this).val() == "Frau") ? $('#form-female').show() : $('#form-female').hide(); ($(this).val() == "Mann") ? $('#form-male').show() : $('#form-male').hide(); if ($(this).val() == "Paar") { $('#form-female').show(); $('#form-male').show(); } }); }); why doesnt this work??? I dont get any error or anything it just sets the value to "<%= @profile.sex =" I was googling and searching about on stack overflow and railscasts, the rails API, everything. Im seriously confused... thanks for your help.

    Read the article

  • Displaying form validation errors in a template (Symfony)

    - by Jay
    Hi, let's say I have a blog with a module "post". now I display a post like this: post/index?id=1 in the index-action i generate a new CommentForm and pass it as $this-form to the template and it is being displayed at the bottom of a post (it's just a textfield, nothing special). form action is set to "post/addcomment". How can I display the validation errors in this form? using setTemplate('index') doesn't work because I would have to pass the id=1 to it... thanks

    Read the article

  • Adding new records in Access without wrecking the form

    - by Matt Parker
    I'm working on a simple Access 2003 application to keep track of things that need to be done for clients for some colleagues. Each colleague has a set of clients, and each client has a set of actions that need to be taken by a certain date. I've set up a form that consists of a combobox for client ID (indexed), a drop-down for the person who is handling that client's case, and a button for adding new clients (a standard Access-created Add Record button). The actions are listed in a subform below these three elements. The problem I've run into is that the first person I tested this on clicked the button to add a new record, then didn't fill it out and tried to select another client from the drop-down list. Access interprets this as an attempt to set the selected Client ID as the ID for the new record and rightfully throws an error for duplicate primary keys. I can think of a couple of ways around this problem, but I'd much rather hear your elegant solutions than kludge together some junk in a language I don't know. Let me know if you have any questions. Thank you.

    Read the article

  • Remembering Form information

    - by Pete Herbert Penito
    Hi everyone! I'm sorry if this has been asked before but I feel my situation is a little different... I have a huge form (like 50 questions involving checkboxes, drop downs, text boxes and textareas) When a user submits a form and the validation page throws an error, is there an easy way to keep the info they entered? My intitial form is on form.php and then the form action is form_posted.php, before anything is run on form_posted.php I have my validation code which sends the user back to form.php with an error number (eg. form.php?error=3) if there was a problem with any in particular. This is done with header("form.php?error=3") so on form.php do the posted variables exist? even tho the page wasn't specifically sent with any posted variables. Also if this is the case, is it completely secure to be making the value of a textbox what it was before? like <input type="text" value="php echo $_POSTED["username"] ?>">

    Read the article

  • How to allow certain HTML tags in a form field in Symfony 1.2

    - by camomileCase
    I'm playing around with Symfony and have encountered a road block. I created a model "CmsPage" which has a field called "content" which is stored as a clob (this is specific to doctrine I believe). When I created the app I set "--escaping-strategy=on" so if I enter any html when editing a CmsPage that gets encoded with html entities or something along those lines. I would like to allow html in this field and a quick googling hasn't helped much. Maybe I'm searching for the wrong terms. Anywho I would like to disable character escaping for this field and possibly only allow a small selection of html tags. What is the correct way to do this in Symfony?

    Read the article

  • How to protect and hidden form HTML/PHP with JS callback to AS3

    - by Jk_
    Hi guys, I'm developing a Flash website (as3) where I need to be able to upload directly to YouTube by using the DATA API. However in order to do so, I had to use a proper HTML form on top of my flash object. Why? Because of the Browser Based Upload restictions. I first hide the form using JQuery and with a little CSS the form is display just where I want it. Within flash I use ExternalInterface.call() to show/hide the form when I need it! ExternalInterface.call("YTUploader.showIt"); The upload process is working great my only problem is that the form can be displayed easily... You just need a tool like firebug and you can use the form wherever you want on my flash app. So I was wandering which will be the best way to 'protect' this form or the best way to limit its access. Any advices will be appreciated. Thanks for your time. Jk.

    Read the article

  • SpringMvc java.lang.NullPointerException When Posting Form To Server

    - by dev_darin
    I have a form with a user name field on it when i tab out of the field i use a RESTFUL Web Service that makes a call to a handler method in the controller. The method makes a call to a DAO class that checks the database if the user name exists. This works fine, however when the form is posted to the server i call the same exact function i would call in the handler method however i get a java.lang.NullPointerException when it accesses the class that makes a call to the DAO object. So it does not even access the DAO object the second time. I have exception handlers around the calls in all my classes that makes calls. Any ideas as to whats happening here why i would get the java.lang.NullPointerException the second time the function is called.Does this have anything to do with Spring instantiating DAO classes using a Singleton method or something to that effect? What can be done to resolve this? This is what happens the First Time The Method is called using the Web Service(this is suppose to happen): 13011 [http-8084-2] INFO com.crimetrack.jdbc.JdbcOfficersDAO - Inside jdbcOfficersDAO 13031 [http-8084-2] DEBUG org.springframework.jdbc.core.JdbcTemplate - Executing prepared SQL query 13034 [http-8084-2] DEBUG org.springframework.jdbc.core.JdbcTemplate - Executing prepared SQL statement [SELECT userName FROM crimetrack.tblofficers WHERE userName = ?] 13071 [http-8084-2] DEBUG org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource 13496 [http-8084-2] DEBUG org.springframework.jdbc.core.StatementCreatorUtils - Setting SQL statement parameter value: column index 1, parameter value [adminz], value class [java.lang.String], SQL type unknown 13534 [http-8084-2] DEBUG org.springframework.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource 13537 [http-8084-2] INFO com.crimetrack.jdbc.JdbcOfficersDAO - No username was found in exception 13537 [http-8084-2] INFO com.crimetrack.service.ValidateUserNameManager - UserName :adminz does NOT exist The Second time When The Form Is 'Post' and a validation method handles the form and calls the same method the web service would call: 17199 [http-8084-2] INFO com.crimetrack.service.OfficerRegistrationValidation - UserName is not null so going to check if its valid for :adminz 17199 [http-8084-2] INFO com.crimetrack.service.OfficerRegistrationValidation - User Name in try.....catch block is adminz 17199 [http-8084-2] INFO com.crimetrack.service.ValidateUserNameManager - Inside Do UserNameExist about to validate with username : adminz 17199 [http-8084-2] INFO com.crimetrack.service.ValidateUserNameManager - UserName :adminz EXCEPTION OCCURED java.lang.NullPointerException

    Read the article

  • Drupal: How to Render Results of Form on Same Page as Form

    - by Aaron
    How would I print the results of a form submission on the same page as the form itself? Relevant hook_menu: $items['admin/content/ncbi_subsites/paths'] = array( 'title' => 'Paths', 'description' => 'Paths for a particular subsite', 'page callback' => 'ncbi_subsites_show_path_page', 'access arguments' => array( 'administer site configuration' ), 'type' => MENU_LOCAL_TASK, ); page callback: function ncbi_subsites_show_path_page() { $f = drupal_get_form('_ncbi_subsites_show_paths_form'); return $f; } Form building function: function _ncbi_subsites_show_paths_form() { // bunch of code here $form['subsite'] = array( '#title' => t('Subsites'), '#type' => 'select', '#description' => 'Choose a subsite to get its paths', '#default_value' => 'Choose a subsite', '#options'=> $tmp, ); $form['showthem'] = array( '#type' => 'submit', '#value' => 'Show paths', '#submit' => array( 'ncbi_subsites_show_paths_submit'), ); return $form; } Submit function (skipped validate function for brevity) function ncbi_subsites_show_paths_submit( &$form, &$form_state ) { //dpm ( $form_state ); $subsite_name = $form_state['values']['subsite']; $subsite = new Subsite( $subsite_name ); //y own class that I use internally in this module $paths = $subsite->normalized_paths; // build list $list = theme_item_list( $paths ); } If I print that $list variable, it is exactly what I want, but I am not sure how to get it into the page with the original form page built from 'ncbi_subsites_show_path_page'. Any help is much appreciated!

    Read the article

  • ASP.NET: Using Session to store authentication?

    - by Niels Bosma
    I'm having a lot of problems with FormsAuthentication (http://stackoverflow.com/questions/2964342/problem-with-asp-net-authentication) and as as potential work around I'm thinking about storing the login in the Session? Login: Session["Auth.ClientId"] = clientId; IsAuthenticated: Session["Auth.ClientId"] != null; Logout; Session["Auth.ClientId"] == null; I'm not really using most of the bells and whistles of FormsAuthentication anyway. Is this a bad idea?

    Read the article

  • breaking datetime into constituent parts ASP.NET MVC form

    - by nick
    hi guys, i have searched the web relentlessly for this and have not found anything - which is surprising because i would think it is such a common scenario! Basically, on my model i have a DateTime field which i wish the user to populate through a form. I am using the Html helper to render all other parts of the form (along with validation) So this question is in two parts... Html Helper Firstly, is there any way to use the Html helper to split the DateTime field to be rendered as the three constituent parts of a date: day, month, year (since i do not care about the time part). This could be rendered as text boxes, drop down lists or a combination of both. Model Binding And then when the form is posted, what is the best approach for binding back up to the model? I have seen Scott Hanselmann's solution to this, but it seems a little bloated for what i need - i was hoping for a slightly more elegant solution. Is it recommended to extend DefaultModelBinder and set that as default binder (since all dates would be handled in this way) or write a class that implements IModelBionder and set it as the default binder for the DateTime type? Thanks for all the help in advance :-) i'm loving MVC but it's infuriating me that something so trivial is causing so much headaches!

    Read the article

  • jQuery focus on content of input / textarea - not working properly in IE8

    - by katebp
    I want the input fields on my site to select all the text when the user first clicks on them, but in IE8 the text is selected for a split second then reverts back to normal. Works fine in FF. My js code: $(document).ready(function () { //HTML DOM document is ready // Add this behavior to all text fields $("input[type='text'], textarea").live("focus", function(){ // Select field contents this.focus(); }); }); Any ideas? I've tried adding ".select()" after "this" and bizarrely enough it works, but throws loads of js errors in FF and IE. Thanks

    Read the article

  • Get Data from Windows Form into C# program

    - by Jimmy
    I want my C# program to collect data. Then, when the OK button is clicked, I want this data to be loaded into my program -- such as into variables in Main(), or into data members of a class I have constructed, and I want the form to then go away -- not be hidden, but actually closed. Alas, read as I might in the book I have, the data collected by the form stays in the form, execution proceeds within the form, and the same form is used to display the result of the program's computations. Sheesh. All I want is to capture the form's information, close the form and proceed with my program. I would appreciate some tips on geting data from a form into Main() or into a class's data members. Thanks, Lucky

    Read the article

  • Ms Access. How to resize a web browser in Access Form?

    - by tksy
    Hi, I have a web browser in my access form. I am embedding a gif file on it. but how ever i re size it there is a white border coming in the top and left side. The adjustments take place only at the bottom and right side. So when i embed a gif file with black background i end up getting a white background on the top and left sides, how do i make this go. thanks tksy

    Read the article

  • How can I get jquery .val() AFTER keypress event?

    - by werner5471
    I got: $(someTextInputField).keypress(function() { alert($(this).val()); }); Now the alert always returns the value BEFORE the keypress (e.g. the field is empty, I type 'a' and the alert gives me ''. Then I type 'b' and the alert gives me 'a'...). But I want the value AFTER the keypress - how can I do that? Background: I'd like to enable a button as soon as the text field contains at least one character. So I run this test on every keypress event, but using the returned val() the result is always one step behind. Using the change() event is not an option for me because then the button is disabled until you leave the text box. If there's a better way to do that, I'm glad to hear it!

    Read the article

  • ZF2 Vertical Form

    - by yunhasnawa
    I created a simple form in typical ZF2 application. The form class code is just a modified code provided by Zend's Album example. <?php namespace Admin\Form; use Zend\Form\Form; class CityForm extends Form { public function __construct($name = null) { parent::__construct('city'); $this->setAttribute('method', 'post'); $this->add(array( 'name' => 'id', 'attributes' => array( 'type' => 'hidden', ), )); $this->add(array( 'name' => 'name', 'attributes' => array( 'type' => 'text' ), 'options' => array( 'label' => 'Name', ), )); $this->add(array( 'name' => 'province', 'attributes' => array( 'type' => 'text' ), 'options' => array( 'label' => 'Province', ), )); $this->add(array( 'name' => 'country', 'attributes' => array( 'type' => 'text' ), 'options' => array( 'label' => 'Country', ), )); $this->add(array( 'name' => 'coordinate', 'attributes' => array( 'type' => 'text' ), 'options' => array( 'label' => 'Coordinate', ), )); $this->add(array( 'name' => 'submit', 'attributes' => array( 'type' => 'submit', 'value' => 'Save', 'id' => 'submitButton', ), )); } } And call it like this in CityController, a typical controller extends AbstractActionController: public function addAction() { $form = new CityForm(); $viewData = array( 'form' => $form ); return new ViewModel($viewData); } Finally in view I echo it like this: <?php $title = 'Add New City'; ?> <?php $this->headtitle($title); ?> <h1><?php echo $this->escapehtml($title); ?></h1> <?php $form = $this->form; ?> <?php $form->setAttribute('action', $this->url('city', array('action' => 'add'))); ?> <?php $form->prepare(); ?> <?php echo $this->form()->openTag($form); echo $this->formHidden($form->get('id')); echo $this->formRow($form->get('name')); echo $this->formRow($form->get('province')); echo $this->formRow($form->get('country')); echo $this->formRow($form->get('coordinate')); echo $this->formSubmit($form->get('submit')); echo $this->form()->closeTag(); ?> What I expected to see is a vertical form like this: But what i got is an ugly form like this: What's wrong with my code? Please help. EDIT: When I inspect element, the form generated is strange. The <input> element is inside the <label> element. <form id="city" name="city" method="post" action="/karciscus/public/admin/city/add"> <input type="hidden" value="" name="id"> <label> <span>Name</span><input type="text" value="" name="name"> </label> <label> <span>Province</span><input type="text" value="" name="province"> </label> <label> <span>Country</span><input type="text" value="" name="country"> </label> <label> <span> Coordinate</span><input type="text" value="" name="coordinate"> </label> <input type="submit" value="Save" id="submitButton" name="submit"> </form> I'm pretty sure it is the cause of my ugly rendered form. I think it is not supposedly like that. How to fix it?

    Read the article

  • Why is this jquery dialog window not displaying?

    - by user338413
    I've got a form that is using jquery validation. When the user clicks the submit button, I've got some jquery that intercepts the submit and should display a dialog window asking the user to verify the information they entered on the form. This dialog window should only display if the form has validated. Here is my code: $('#form').submit(function(){ fillVerificationDialog(); /* This loads up the dialog with form data */ if (('#form').valid()){ $('verification_dialog').dialog('open'); return false; } }); My dialog window is not displaying. It just submits the form. And I've verified that the form is valid by using an alert that checks the value of $('#form').valid() If I remove the if statement and just have the line that opens the dialog, the dialog displays. However, it will display even if the form has errors which is what I'm trying to prevent.

    Read the article

  • can't save form content to database, help plsss!!

    - by dana
    i'm trying to save 100 caracters form user in a 'microblog' minimal application. my code seems to not have any mystakes, but doesn't work. the mistake is in views.py, i can't save the foreign key to user table models.py looks like this: class NewManager(models.Manager): def create_post(self, post, username): new = self.model(post=post, created_by=username) new.save() return new class New(models.Model): post = models.CharField(max_length=120) date = models.DateTimeField(auto_now_add=True) created_by = models.ForeignKey(User, blank=True) objects = NewManager() class NewForm(ModelForm): class Meta: model = New fields = ['post'] # widgets = {'post': Textarea(attrs={'cols': 80, 'rows': 20}) def save_new(request): if request.method == 'POST': created_by = User.objects.get(created_by = user) date = request.POST.get('date', '') post = request.POST.get('post', '') new_obj = New(post=post, date=date, created_by=created_by) new_obj.save() return HttpResponseRedirect('/') else: form = NewForm() return render_to_response('news/new_form.html', {'form': form},context_instance=RequestContext(request)) i didn't mention imports here - they're done right, anyway. my mistake is in views.py, when i try to save it says: local variable 'created_by' referenced before assignment it i put created_py as a parameter, the save needs more parameters... it is really weird help please!!

    Read the article

  • Form Arrays support across browsers

    - by Stomped
    I'm not even sure if form arrays is the proper term, but it looks a bit like this: <input name='element[]' type='text' /> <input name='element[]' type='text' /> Which is then retrieved in PHP as an array stored in $_POST['element'] -- in this case with 2 values. I've tested it in the browsers I have available to me, but I've never seen this before and I'm wondering is this supported pretty much in all browsers? Or is this something very old that I've just not run into? Thanks!

    Read the article

  • Stop an input field in a form from being submitted

    - by Acorn
    I'm writing some javascript that will insert some input fields into a form on a website. The thing is, I don't want those input fields to affect the form in any way, I don't want them to be submitted when the form is submitted, I only want my javascript to have access to their values. Is there some way I could add some input fields into the middle of a form and not have them submitted when the form is submitted? Obviously the ideal thing would be for the input fields to not be in the form element, but I want the layout of my resulting page to have my inserted input fields appear between elements of the original form.

    Read the article

  • How to nest a form in an ASP.NET page (which has a form wrapped around it)

    - by Josh
    I am writing HTML to an ASP.NET page (from a web service response), and the HTML has tags. Unfortunately, because the ASP.NET page already has a wrapped around it, a lot of the buttons on the page break. Does anyone know how I can nest the form inside the ASP.NET page without breaking the top-level form? Note: the HTML I am bringing in is a form with a bunch of hidden fields inside of it, and it has to be placed within the ASP.NET page, and thus nested in the top-level form. Thanks

    Read the article

  • codeigniter populate form from database

    - by Delirium tremens
    In the controller, I have... function update($id = null) { $this->load->database(); // more code $data = array(); $data = $this->db->get_where( 'users', array( 'id' => $id ) ); $data = $data->result_array(); $data = $data[0]; // more code $this->load->view('update', $data); } In the view, I have... <h5>Username</h5> <input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" /> <h5>Email</h5> <input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" /> <h5>Email Confirmation</h5> <input type="text" name="emailconf" value="<?php echo set_value('emailconf'); ?>" size="50" /> <h5>Password</h5> <input type="text" name="password" value="<?php echo set_value('password'); ?>" size="50" /> <h5>Password Confirmation</h5> <input type="text" name="passconf" value="<?php echo set_value('passconf'); ?>" size="50" /> set_value() isn't reading $data search for value="" at http://codeigniter.com/forums/viewthread/103837/ The poster uses only the set_value() function between "" in value="". I'm wondering how to do the same, but I can't get it to work. Help?

    Read the article

  • PHP Form - Empty input enter this text - Validation

    - by James Skelton
    No doubt very simple question for someone with php knowledge. I have a form with a datepicker, all is fine when a user has selected a date the email is send with: Date: 2012 04 10 But i would like if the user has skipped this and left blank (as i have not made this required) to send as: Date: Not Entered (<-- Or something) Instead at the minute of course it reads: Date: Form input <input type="text" class="form-control" id="datepicker" name="datepicker" size="50" value="Date Of Wedding" /> This is the validator $(document).ready(function(){ //validation contact form $('#submit').click(function(event){ event.preventDefault(); var fname = $('#name').val(); var validInput = new RegExp(/^[a-zA-Z0-9\s]+$/); var email = $('#email').val(); var validEmail = new RegExp(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/); var message = $('#message').val(); if(fname==''){ showError('<div class="alert alert-danger">Please enter your name.</div>', $('#name')); $('#name').addClass('required'); return;} if(!validInput.test(fname)){ showError('<div class="alert alert-danger">Please enter a valid name.</div>', $('#name')); $('#name').addClass('required'); return;} if(email==''){ showError('<div class="alert alert-danger">Please enter an email address.</div>', $('#email')); $('#email').addClass('required'); return;} if(!validEmail.test(email)){ showError('<div class="alert alert-danger">Please enter a valid email.</div>', $('#email')); $('#email').addClass('required'); return;} if(message==''){ showError('<div class="alert alert-danger">Please enter a message.</div>', $('#message')); $('#message').addClass('required'); return;} // setup some local variables var request; var form = $(this).closest('form'); // serialize the data in the form var serializedData = form.serialize(); // fire off the request to /contact.php request = $.ajax({ url: "contact.php", type: "post", data: serializedData }); // callback handler that will be called on success request.done(function (response, textStatus, jqXHR){ $('.contactWrap').show( 'slow' ).fadeIn("slow").html(' <div class="alert alert-success centered"><h3>Thank you! Your message has been sent.</h3></div> '); }); // callback handler that will be called on failure request.fail(function (jqXHR, textStatus, errorThrown){ // log the error to the console console.error( "The following error occured: "+ textStatus, errorThrown ); }); }); //remove 'required' class and hide error $('input, textarea').keyup( function(event){ if($(this).hasClass('required')){ $(this).removeClass('required'); $('.error').hide("slow").fadeOut("slow"); } }); // show error showError = function (error, target){ $('.error').removeClass('hidden').show("slow").fadeIn("slow").html(error); $('.error').data('target', target); $(target).focus(); console.log(target); console.log(error); return; } });

    Read the article

  • Iteratively creating multiple file input fields in Rails

    - by David
    I have a column of product views in a database (e.g. top, bottom, front, back). I'm trying to generate a series of file inputs to allow the user to upload an image for each view. This is the result I'm after: ... <label>Top</label> <input type="file" name="image[Top]"><br> <label>Bottom</label> <input type="file" name="image[Bottom]"><br> <label>Front</label> <input type="file" name="image[Front']"><br> ... This is what I'm trying: <%= views = View.order('name ASC').all.map { |view| [view.name, view.id] } %> <%= views.each { |view| label(view); file_field('image', view) } %> However, all this does is print out the views array a couple of times. Hopefully you Rails experts can point me in the right direction. (I apologize in advance if I'm butchering Ruby.)

    Read the article

< Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >