Search Results

Search found 18346 results on 734 pages for 'form for'.

Page 31/734 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • how to add special class for labels and errors on zend form elements?

    - by user1400
    hello how we could add a special class for labels and errors for a zend-form-element for example html output code before add classes <dt id="username-label"><label for="username" class="required">user name:</label></dt> <dd id="username-element"> <input type="text" name="username" id="username" value="" class="input" /> <ul class="errors"><li>Value is required and can't be empty</li></ul></dd> and code after we add classes <dt id="username-label"><label for="username" **class="req-username"**>user name:</label></dt> <dd id="username-element"> <input type="text" name="username" id="username" value="" class="input" /> <ul **class="err-username"**><li>Value is required and can't be empty</li></ul></dd> thanks

    Read the article

  • How do I create multiple submit buttons for the same form in Rails?

    - by Angela
    I need to have multiple submit buttons. I have a form which creates an instance of Contact_Call. One button creates it as normal. The other button creates it but needs to have a different :attribute value from the default, and it also needs to set the attribute on a different, but related model used in the controller. How do I do that? I can't change the route, so is there a way to send a different variable that gets picked up by [:params]? And if I do then, what do I do in the controller, set up a case statement?

    Read the article

  • why could i not submit the form via php's curl?

    - by home
    $ua_s = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'; $c = curl_init($the_url); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($c, CURLOPT_USERAGENT, $ua_s); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $post_string); $cont = curl_exec($c); curl_close($c); send all needed fields but fail to submit it properly. wrote html form to test - all is well if done so in browser:

    Read the article

  • Sharepoint 2007 : Saving Form data with page redirection using custom parameters.

    - by Deepu
    HI Experts, After saving the form data I would like to REDIRECT to different pages based on the @Status value using the input type button. <input type="button" value="Save" name="btnSave" id="btnSave" onclick="{ddwrt:GenFireServerEvent('_commit;_redirect={*Confirm.aspx?ID=1}')};" /* if @Status == "Draft" url = "draft.aspx ? ID = " @ID else if @Status == "Save" url = "save.aspx ? ID = " @ID else url = "confirm.aspx ? ID = " @ID Here @ID and @Status are share point list column names Now I have hard-coded the url Confirm.aspx?ID=4. But I want to check the status value using XSLT condition and set different URL name with @ID value.. How do I achieve this.. any help would be appreciated.. thanks deepu

    Read the article

  • Pass HTML form entries into a Javascript array to then be written to a client side cookie?

    - by Tom
    I'm building a bit of a test-case JS application, something very basic, but have run into some problems. I'm trying to use a HTML form for a user to enter a number, which is then written to a Javascript Array. The user then has the option to write that same array to a local (client side) cookie. (I understand the security implications of this - it's a test-case and not for commercial use.) However, I can't make the connection - how can I capture the HTML entry, press 'submit' which will send it to a JS array, where the user can then press a different 'submit' which will write the array to a text file? If anyone can help I'd appreciate it because it's been nearly 6 hours and it's not funny anymore.

    Read the article

  • How to require a checkbox to be checked at client side before form gets submitted to server in MVC 3?

    - by Projapati
    I have a Terms and Condition checkbox on my signup page. I want to make it required like my few other fields on the form before posting to server. This validation must be done at client side. Anyone knows how to do it properly? I am using MVC 3, jquery.validate.min.js and jquery.validate.unobtrusive.min.js Model: [Required(ErrorMessage = "terms and condition")] [Display(Name = "terms")] public bool Terms { get; set; } View: @Html.CheckBoxFor(m => m.Terms, new { @class = "cb" }) Terms & Condition <button type="submit" id="btnSubmit" class="btn">Signup</button> Also, Is it possible to call/trap some JS function when the submit button is clicked? That way I can easily use jquery to do validation and then submit? Thanks for reading

    Read the article

  • PHP: Simulate a <form> tag with POST data and also redirecting the user...

    - by tarnfeld
    Hi, I have been scouring the internet for a way to do this with no luck :( Basically, it's easy to make a form in HTML with a submit button and some data, and send it to a URL. With this you send the POST data and also the user is taken to the page. I know you can send POST data using cURL and get a response back in PHP but how do I take the user there, I need to simulate exactly what a tag does in php. Some sample code or links would be great! Thanks in advanced...

    Read the article

  • Form submit to target iframe only works once

    - by Pointy
    I'm having a really irritating problem doing something that I'm sure I've done before. The setup is this: There's a form which is submitted via a "click" handler on a button, though the submit is ultimately a simple call to the form's native submit() function. The form's target is an iframe, which is initially filled with an empty page (that is, its source object is an URL for an empty page). That is, the "target" attribute of the form is the same identifier (and yes, it's a valid identifier) as the "name" and "id" attributes of the iframe (and yes, it's unique) Now the goal of this setup is as follows: the form contains file upload fields. Should something be wrong with one of the files uploaded, the server will report back an error. If the error response (that is, the html page with a new copy of the form, along with appropriate error messages) were to be allowed to reload the original window, then the file input fields would be cleared. That's not good. Thus the form submits to the iframe, so that the response from the server can be a small page that knows it's in that hidden iframe, and knows to move the error messages up to the form. One more thing: the form itself is also in an iframe, as part of a popup modal dialog (like a jQuery UI dialog, only slightly different; same idea though). The setup works fine - on the first submit. In other words, if I supply nice happy files to upload, the server ships back the successful response, and the dialog is closed correctly. If I send a bogus file, the server responds with an error page that correctly copies its stuff up to the form page. On the second submit, however (like, if I fix the bogus file input field), the browser insists on sending the server response to a new browser tab. As far as I can tell, the form's "target" remains correct, the iframe "name" and "id" attributes aren't changed, and I even make sure to update the hidden iframe "window.name" and "window.id" values. None of that is helping; I always get a new browser tab. I'm trying to set up a slightly simpler test case to see if I can rule out some of my framework code (the stuff that does the submit), though via a few console.log() calls I think that stuff is OK; it's certainly OK on all the other dialogs etc. in the site. When/if I create a simpler version I'll post it. In the meantime, if any of you insanely smart people recognize this situation and know of a trick to make it work, I'd be really thankful. I see the same behavior in both Firefox (3.6) and Chrome, so it's got to be my problem and not a browser quirk (well, at least that's what I think to be true).

    Read the article

  • SpringMvc java.lang.NullPointerException When Posting Form To Server [closed]

    - 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 ValidateUserNameManager.java public class ValidateUserNameManager implements ValidateUserNameIFace { private OfficersDAO officerDao; private final Logger logger = Logger.getLogger(getClass()); public boolean DoesUserNameExist(String userName) throws Exception { logger.info("Inside Do UserNameExist about to validate with username : " + userName); try{ if(officerDao.OfficerExist(userName) == true){ logger.info("UserName :" + userName + " does exist"); return true; }else{ logger.info("UserName :" + userName + " does NOT exist"); return false; } }catch(Exception e){ logger.info("UserName :" + userName + " EXCEPTION OCCURED " + e.toString()); return false; } } /** * @return the officerDao */ public OfficersDAO getOfficerDao() { return officerDao; } /** * @param officerdao the officerDao to set */ public void setOfficerDao(OfficersDAO officerDao) { this.officerDao = officerDao; } } JdbcOfficersDAO.java public boolean OfficerExist(String userName){ String dbUserName; try{ logger.info("Inside jdbcOfficersDAO"); String sql = "SELECT userName FROM crimetrack.tblofficers WHERE userName = ?"; try{ dbUserName = (String)getJdbcTemplate().queryForObject(sql, new Object[]{userName},String.class); logger.info("Just Returned from database"); }catch(Exception e){ logger.info("No username was found in exception"); return false; } if(dbUserName == null){ logger.info("Database did not find any matching records"); } logger.info("after JdbcTemplate"); if (dbUserName.equals(userName)) { logger.info("User Name Exists"); return true; }else{ logger.info("User Name Does NOT Exists"); return false; } }catch(Exception e){ logger.info("Exception Message in JdbcOfficersDAO is "+e.getMessage()); return false; } } OfficerRegistrationValidation.java public class OfficerRegistrationValidation implements Validator{ private final Logger logger = Logger.getLogger(getClass()); private ValidateUserNameManager validateUserNameManager; public boolean supports(Class<?> clazz) { return Officers.class.equals(clazz); } public void validate(Object target, Errors errors) { Officers officer = (Officers) target; if (officer.getUserName() == null){ errors.rejectValue("userName", "userName.required"); }else{ String userName = officer.getUserName(); logger.info("UserName is not null so going to check if its valid for :" + userName); try { logger.info("User Name in try.....catch block is " + userName); if (validateUserNameManager.DoesUserNameExist(userName)== true){ errors.rejectValue("userName", "userName.exist"); } } catch (Exception e) { logger.info("Error Occured When validating UserName"); errors.rejectValue("userName", "userName.error"); } } if(officer.getPassword()== null){ errors.rejectValue("password", "password.required"); } if(officer.getPassword2()== null){ errors.rejectValue("password2", "password2.required"); } if(officer.getfName() == null){ errors.rejectValue("fName","fName.required"); } if(officer.getlName() == null){ errors.rejectValue("lName", "lName.required"); } if (officer.getoName() == null){ errors.rejectValue("oName", "oName.required"); } if (officer.getEmailAdd() == null){ errors.rejectValue("emailAdd", "emailAdd.required"); } if (officer.getDob() == null){ errors.rejectValue("dob", "dob.required"); } if (officer.getGenderId().equals("A")){ errors.rejectValue("genderId","genderId.required"); } if(officer.getDivisionNo() == 1){ errors.rejectValue("divisionNo", "divisionNo.required"); } if(officer.getPositionId() == 1){ errors.rejectValue("positionId", "positionId.required"); } if (officer.getStartDate() == null){ errors.rejectValue("startDate","startDate.required"); } if(officer.getEndDate() == null){ errors.rejectValue("endDate","endDate.required"); } logger.info("The Gender ID is " + officer.getGenderId().toString()); if(officer.getPhoneNo() == null){ errors.rejectValue("phoneNo", "phoneNo.required"); } } /** * @return the validateUserNameManager */ public ValidateUserNameManager getValidateUserNameManager() { return validateUserNameManager; } /** * @param validateUserNameManager the validateUserNameManager to set */ public void setValidateUserNameManager( ValidateUserNameManager validateUserNameManager) { this.validateUserNameManager = validateUserNameManager; } } Update Error Log using Logger.Error("Message", e): 39024 [http-8084-2] INFO com.crimetrack.service.OfficerRegistrationValidation - UserName is not null so going to check if its valid for :adminz 39025 [http-8084-2] INFO com.crimetrack.service.OfficerRegistrationValidation - User Name in try.....catch block is adminz 39025 [http-8084-2] ERROR com.crimetrack.service.OfficerRegistrationValidation - Message java.lang.NullPointerException at com.crimetrack.service.OfficerRegistrationValidation.validate(OfficerRegistrationValidation.java:47) at org.springframework.validation.DataBinder.validate(DataBinder.java:725) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doBind(HandlerMethodInvoker.java:815) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:367) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:171) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source) 39025 [http-8084-2] INFO com.crimetrack.service.OfficerRegistrationValidation - Error Occured When validating UserName

    Read the article

  • How do I encapsulate form/post/validation[/redirect] in ViewUserControl in ASP.Net MVC 2

    - by paul
    What I am trying to achieve: encapsulate a Login (or any) Form to be reused across site post to self when Login/validation fails, show original page with Validation Summary (some might argue to just post to Login Page and show Validation Summary there; if what I'm trying to achieve isn't possible, I will just go that route) when Login succeeds, redirect to /App/Home/Index also, want to: stick to PRG principles avoid ajax keep Login Form (UserController.Login()) as encapsulated as possible; avoid having to implement HomeController.Login() since the Login Form might appear elsewhere All but the redirect works. My approach thus far has been: Home/Index includes Login Form: <%Html.RenderAction("Login","User");%> User/Login ViewUserControl<UserLoginViewModel> includes: <%=Html.ValidationSummary("") % using(Html.BeginForm()){} includes hidden form field "userlogin"="1" public class UserController : BaseController { ... [AcceptPostWhenFieldExists(FieldName = "userlogin")] public ActionResult Login(UserLoginViewModel model, FormCollection form){ if (ModelState.IsValid) { if(checkUserCredentials()) { setUserCredentials() return this.RedirectToAction<Areas.App.Controllers.HomeController>(x = x.Index()); } else { return View(); } } ... } Works great when: ModelState or User Credentials fail -- return View() does yield to Home/Index and displays appropriate validation summary. (I have a Register Form on the same page, using the same structure. Each form's validation summary only shows when that form is submitted.) Fails when: ModelState and User Credentials valid -- RedirectToAction<>() gives following error: "Child actions are not allowed to perform redirect actions." It seems like in the Classic ASP days, this would've been solved with Response.Buffer=True. Is there an equivalent setting or workaround now? Btw, running: ASP.Net 4, MVC 2, VS 2010, Dev/Debugging Web Server I hope all of that makes sense. So, what are my options? Or where am I going wrong in my approach? tia!

    Read the article

  • Visual Studio 2005 - OleDbConnection throws "Invalid authorization specification" in Form Designer,

    - by Jason Dagit
    I have a form with an OleDbConnection object on it. This form fails to load in the Form Designer with the message: One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. Invalid authorization specification at ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options) ... (stack trace continues into user code) I've tracked this down to the OleDbConnection string. If I hardcode in the server IP, username/password/dbinstance into the constructor of the GUI form then the form will load in the designer. At run-time it is not an issue because we require the user to provide the login details. The question: Is it possible to use the OleDbConnection and the Form designer without supplying the database credentials in the source code of the form? For example, is there a property of the OleDbConnection or Form that I can set so that it doesn't need to access the database during Form design? My concern is that if we ever move the database server or change the login that the code will stop working in the designer.

    Read the article

  • Winforms: How to display a "loading" form?

    - by Martijn
    I have a grid and when a row is double clicked a form is loaded. However a lot of data must be loaded, so I'd like to display a simple form with the text 'loading, please wait..'. And when all loading is finished, the form must disappear. This is what I have right now, but it doesn't work: Code that invokes the form with lots of data: FormWithLotData form = new FormWithLotData(); form.ShowDialog(this); Constructor of FormWithLotData: // Show load form FormIsLoading frm = new FormIsLoading(); _CloseLoadForm closeForm = new _CloseLoadForm(frm.Close); System.Threading.Thread thread = new System.Threading.Thread(frm.Show); thread.Start(); InitializeComponent(); this.Visible = false; LoadAllData(); this.Visible = true; // Close load form Invoke(closeForm); Hope you can help me out. EDIT: I'd like to show an animated gif on the loading form.

    Read the article

  • Django Cannot set values on a ManyToManyField which specifies an intermediary model

    - by dana
    i am using a m2m and a through table, and when i was trying to save, my error was: Cannot set values on a ManyToManyField which specifies an intermediary model so, i've modified my code, so that when i save the form, to insert data into the 'through' table too.But now, i'm having another error. (i've bolded the lines where i think i am wrong) i have in models.py: class Classroom(models.Model): user = models.ForeignKey(User, related_name = 'classroom_creator') classname = models.CharField(max_length=140, unique = True) date = models.DateTimeField(auto_now=True) open_class = models.BooleanField(default=True) members = models.ManyToManyField(User,related_name="list of invited members", through = 'Membership') class Membership(models.Model): accept = models.BooleanField(User) date = models.DateTimeField(auto_now = True) classroom = models.ForeignKey(Classroom, related_name = 'classroom_membership') member = models.ForeignKey(User, related_name = 'user_membership') and in def save_classroom(request): if request.method == 'POST': form = ClassroomForm(request.POST, request.FILES, user = request.user) **classroom_instance = Classroom member_instance = Membership** if form.is_valid(): new_obj = form.save(commit=False) new_obj.user = request.user r = Relations.objects.filter(initiated_by = request.user) membership = Membership.objects.create(**classroom = classroom_instance, member = member_instance,date=datetime.datetime.now())** new_obj.save() form.save_m2m() return HttpResponseRedirect('/classroom/classroom_view/{{user}}/') else: form = ClassroomForm(user = request.user) return render_to_response('classroom/classroom_form.html', { 'form': form, }, context_instance=RequestContext(request)) but i don't seem to initialise okay the classroom_instance and menber_instance.My error os: Cannot assign "": "Membership.classroom" must be a "Classroom" instance. Thanks!

    Read the article

  • Django: Save data from form in DB

    - by Anry
    I have a model: class Cost(models.Model): project = models.ForeignKey(Project) cost = models.FloatField() date = models.DateField() For the model I created a class form: class CostForm(ModelForm): class Meta: model = Cost fields = ['date', 'cost'] view.py: def cost(request, offset): if request.method == 'POST': #HOW save data in DB? return HttpResponseRedirect('/') else: form = CostForm() In the template file determined: <form action="/cost/{{ project }}/" method="post" accept-charset="utf-8"> <label for="date">Date:</label><input type="text" name="date" value={{ current_date }} id="date" /> <label for="cost">Cost:</label><input type="text" name="cost" value="0" id="cost" /> <p><input type="submit" value="Add"></p> </form> How save data from form in DB? P.S. offset = project name Model: class Project(models.Model): title = models.CharField(max_length=150) url = models.URLField() manager = models.ForeignKey(User) timestamp = models.DateTimeField() I tried to write: def cost(request, offset): if request.method == 'POST': form = CostForm(request.POST) if form.is_valid(): instance = form.save(commit=False) instance.project = Project.objects.filter(title=offset) instance.date = request.date instance.cost = request.cost instance.save() return HttpResponseRedirect('/') else: form = CostForm() But it does not work :(

    Read the article

  • Databinding Textbox to Form.Text (title)

    - by MysticEarth
    I'm trying to bind a Textbox.Text to Form.Text (which sets the title of the form). The binding itself works. But, the title isn't updated until I move the entire form. How can I achieve Form.Text being updated without moving the form? I'd like Form.Text being updated directly when I type something in the Textbox. Edit; I set the title of the Form in a TextChanged event which is fired by a ToolStripTextbox: public partial class ProjectForm : Form { public ProjectForm() { // my code contains all sorts of code here, // but nothing that has something to do with the text. } } private void projectName_TextChanged_1(object sender, EventArgs e) { this.Text = projectName.TextBox.Text; } And the Databinding version: public partial class ProjectForm : Form { public ProjectForm() { this.projectName.TextBox.DataBindings.Add("Text", this, "Text", true, DataSourceUpdateMode.OnValidation); } } Edit 2: I see I forgot to mention something. Don't know if it adds anything, but my apllication is a MDI application. The part of the title that changes is: ApplicationName [THIS CHANGES, BUT ONLY AFTER MOVING/RESIZING]

    Read the article

  • Value missing from form.fieldnames in ColdFusion

    - by Patrick McElhaney
    I must be losing my mind. <cfif cgi.request_method eq "POST"> <cfoutput> Form.fieldnames = #form.fieldnames#<br> structKeyList(form) = #structKeyList(form)# </cfoutput> </cfif> <form method="post" accept-charset="utf-8"> <input type="text" name="graduation_date" value="x"><br> <input type="text" name="foo" value="y"><br> <input type="text" name="bar" value="z"><br> <input type="submit" value="Submit Form" > </form> The form.fieldnames variable should include a list of submitted fields: foo, bar, and graduation_date. But graduation_date is missing. After a little more testing, I see that anything ending in _date is excluded from form.fieldnames. I was going to ask what's wrong with my code, but now I'm pretty convinced it's a bug in ColdFusion. (I'm on ColdFusion 8.0.1 / OS X 10.5.6.) It's a bug in ColdFusion, right?

    Read the article

  • Symfony form->bind fails

    - by Shawn Craver
    I'm working with a few custom forms, and one of them isn't binding it's values on a POST. I'm using the same logic for each, and only one of them isn't working. Here's the code: public function executeMediaFileUpload(sfWebRequest $request) { $this->form = new MediaFileUploadForm(); if (!$request->isMethod('POST')) $psk = $request->getParameter('psk'); else { $this->form->bind($request->getParameter($this->form->getName()), $request->getFiles($this->form->getName())); $this->logMessage('VALUE: ' . $this->form->getValue('version')); $psk = $this->form->getValue('application'); } $this->logMessage('PSK: ' . $psk); $app = Doctrine::getTable('Application')->find(array($psk)); $this->form->setDefault('application', $app->getPsk()); $this->form->setDefault('version', $app->getVersion()->getLast()->getPsk()); On the initial GET, I can see the value passed in via psk getting set as the default for application in the generated HTML, and all the values show up in the POST request in Firebug, but after I bind the form, it still contains no values.

    Read the article

  • CakePHP – 2 controllers, 1 form

    - by user1327
    I need to create a review form. I have 2 models and 2 controllers – Products and Reviews with 'Products' hasMany 'Reviews' relationship, the review form will be displayed on the current product page (Products controller, 'view' action), and this form will be use another controller (Reviews). Also I need validation with validation errors being displayed for this form. In my Products controller view.ctp I have: // product page stuff... echo $this->Form->create($model = 'Review', array('url' => '/reviews/add')); echo $this->Form->input('name', array('label' => 'Your name:')); echo $this->Form->input('email', array('label' => 'Your e-mail:')); echo $this->Form->input('message', array('rows' => '6', 'label' => 'Your message:')); echo $this->Form->end('Send'); echo $this->Session->flash(); ReviewsController - add: public function add() { if ($this->request->is('post')) { $this->Review->save($this->request->data); $this->redirect(array('controller' => 'products', 'action' => 'view', $this->request->data['Review']['product_id'], '#' => 'reviews')); } } Somehow this horrible code works.. in part. Review saves, but I don't get validation errors, and I can't add 'if ($this->Review->save($this->request->data);) { //... } because it will break this action (missed view error). My question is how to properly deal with this situation to achieve functionality that I need? Should I use elements with request action or I should move adding reviews to the ProductsController?

    Read the article

  • cakephp - form for belongsTo Model

    - by user1511579
    I createt the following model to link 2 relational tables: class Ficha extends AppModel { //public $useTable = 'ficha_seg'; var $primaryKey = 'id_ficha'; var $name = 'Ficha'; var $belongsTo = array( 'Perigo' => array( 'className' => 'Perigo', 'foreignKey' => false, 'conditions' => 'Perigo.id_fichas = Ficha.id_ficha' ) ); } Now, i have a form that requires data from the class Ficha, and then is redirected to another ctp page where i will input the data for the table "Perigos". However, since i'm still a newbie in cakephp i'm having difficult building that second form to insert the data on the table "Perigos". Here goes the code i built at the moment related to the second form: FichasController.php (the method where is it supposed to save the data on the table "Perigos": public function preencher_ficha(){ if ($this->request->is('ficha')) { $this->Ficha->create(); if ($this->Ficha->Perigo->save($this->request->data)) { $last_id=$this->Ficha->getLastInsertID(); $this->Session->setFlash('Your post has been updated '.$last_id.'.'); //$this->redirect(array('action' => 'preencher_ficha')); } else { $this->Session->setFlash('Unable to qualquer coisa your post.'); } } } The preencher_ficha.ctp file with the form: echo $this->Form->create('Ficha->Perigo', array('action' => 'index')); echo $this->Form->input('class_subst', array('label' => 'Classificação:')); echo $this->Form->input('simbolos_perigo', array('label' => 'Símbolos:')); echo $this->Form->input('frases_r', array('label' => 'Frases:')); echo $this->Form->end('Finalizar Ficha'); Here i guess the create part is wrong, but i think i have errors too in the controller part.

    Read the article

  • Highlight active form with CSS?

    - by 2unco
    <!doctype html> <html lang="en"> <head> <meta charset="utf-8"/> <style> form:focus{ background:red; } </style> <title>Home, sweet home</title> </head> <body> <form> <input type="text"/> <input type="submit"/> </form> <form> <input type="text"/> <input type="submit"/> </form> <form> <input type="text"/> <input type="submit"/> </form> </body> </html> This obviously doesn't work, as is why I'm asking the question. How can I get the form which has one if it's inputs as the focus to highlight? That is, I want to be able to apply styles to the active FORM, not the active INPUT - is that doable without JS or something?

    Read the article

  • Advantages to Server Scripting languages over Client Side Scripting languages

    There are numerous advantages to server scripting languages over client side scripting languages in regards to creating web sites that are more compelling compared to a standard static site. Server side scripts are executed on a web server during the compilation of data to return to a client. These scripts allow developers to modify the content that is being sent to the user prior to the return of the data to the user as well as store information about the user. In addition, server side scripts allow for a controllable environment in which they can be executed. This cannot be said for client side languages because the developer cannot control the users’ environment compared to a web server. Some users may turn off client scripts, some may be only allow limited access on the system and others may be able to gain full control of the environment.  I have been developing web applications for over 9+ years, and I have used server side languages for most of the applications I have built.  Here is a list of common things I have developed with server side scripts. List of Common Generic Functionality: Send Email FTP Files Security/ Access Control Encryption URL rewriting Data Access Data Creation I/O Access The one important feature server side languages will help me with on my website is Data Access because my component will be backed with a SQL server database. I believe that form validation is one instance where I might see server side and client side scripts used interchangeably because it does not matter how or where the data is validated as long as the data that gets inserted is valid.

    Read the article

  • Lotus Notes 8.0.2 - how to stop all mail showing in customized view

    - by mikolajek
    I am using Lotus Notes 8.0.2 at work and unfortunately the admin restricted changing default folders design. Only little changes are possible (e.g. change columns order) and even them are resetted each time I restart the client. I've created a new view with my desired column order, changed sorting etc. I have only one problem - even though I changed the "view" preference to show messages from the inbox folder only, I keep seeing all mail, regardless of the folder they are placed into. I'm not a Lotus expert and don't really know how to code. Yet, I am surprised as I see in a "simple view" this: uses '(ChangeMeetingType), ...' form AND In folder 'Inbox' And in Formula view only this: SELECT ((Form = "(ChangeMeetingType)") | (Form = "(Return Receipt)") | (Form = "Return Receipt") | (Form = "(ReturnNonReceipt)") | (Form = "ReturnNonReceipt") | (Form = "Memo") | (Form = "Memo") | (Form = "MemoEA") | (Form = "Reply") | (Form = "Reply") | (Form = "Reply With History") | (Form = "Reply With History") | (Form = "To Do") | (Form = "Task") | (Form = "_Document Memo") | (Form = "$DocMemo") | (Form = "Word. Document$Word Memo") | (Form = "WordPro. Document$Word Pro Memo") | (Form = "AlternateMemo")) Therefore, it looks like no folder has been really selected. How can I create a solution to see: Inbox contents only? Just messages, invitations and other "normal" stuff - without calendar entries and contacts?

    Read the article

  • Merging/filling pdf form file with xml data

    - by Giorgi
    Hello, Let's say I have a pdf form file available at website which is filled by the users and submitted to the server. On the server side (Asp.Net) I would like to merge the data that I receive in xml format with the empty pdf form that was filled and save it. As I have found there are several possible ways of doing it: Using pdf form created by adobe acrobat and filling it with itextsharp. Using pdf form created by adobe acrobat and filling it with FDF Toolkit .net (which seems to be using itextsharp internally) Usd pdfkt to fill the form. Use pdf form file created with adobe livecycle and merge the data by using Form Data Integration Service As I have no experience with this kind of task can you advise which option would be better/easier and give some additional tips? Thank you in advance.

    Read the article

  • Custom Display Form with Custom Workflow button

    - by Ifi
    I have created a new custom list form that will show 4 fields on the page from a Custom List called "Shipment". I have added Form Action button that I would like to run a custom action that is set inside of a Workflow. Currently, the form displays the fields for "Manifest Number", "Pickup Location", "Delivery Location", & "Scheduled Pickup Time". When the user clicks the Form Action button, what I want the Workflow to do is go to the ID field of the displayed content in the Form and change the value of the "Picked Up" column from No to Yes. The problem I am having is passing the ID of the displayed information from the Form to the Workflow as a variable. I can get the "Picked Up" column to update if I specify the value in the "Update List Item" window under the "Find the List Item" section, but I cannot figure out how to do this dynamically from the Form

    Read the article

  • Cakephp 1.3 Form Alignment?

    - by Sham Ali
    Hi Fellwos i am new at cakephp 1.3, i am trying to create a Edit User Form with Form Helper in Cakephp 1.3. i am unable to make a customize alignments of the form elements. for example echo $this-Form-create('Model', array('action' = 'edit_users','id' = 'UserForm')); echo $this-Form-input('First Name',array('style'='width:100px','label'='First Name:')); echo $this-Form-input('Last Name',array('style'='width:100px','label'='Last Name:')); echo $this-Form-input('Position',array('style'='width:100px','label'='Position:')); i want first two input fields in single line and 3rd input field in 2nd line, i have tried it with div false, but its not working. if anybody can help me, thanks in advance

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >