Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Two Text Fields in a Form

Options
  • 09-04-2015 11:23pm
    #1
    Registered Users Posts: 766 ✭✭✭


    Ok I thought this was the best place to post this.

    I have a form.....with a hidden text field and a text field for posting messages.

    The Hidden field is used for Headlines which I want to come through identifying where it came from and whom if the person forgets to put that in the message.

    The thing is I do not want a comma separating the two when it comes through.

    Example:

    HEADLINE , This is the message

    I don't know even the search term to trawl through google....is it possible to remove this comma or even replace it with a dash "-" instead?

    thanks


Comments

  • Registered Users Posts: 419 ✭✭Mort5000


    Which language?


  • Registered Users Posts: 5,543 ✭✭✭veryangryman


    if its java something like...

    String beforeString = "Stuff,moreStuff";
    String afterString = beforeString.replace(",", " ")

    This replaces the comma with a space, effectively removing the comma. Put the dash where the space is to do the desired if thats what you prefer.


  • Registered Users Posts: 11,977 ✭✭✭✭Giblet


    The two inputs have the same name or id, this will cause them to concat together with a ",".
    Give the inputs unique names.


  • Registered Users Posts: 766 ✭✭✭EIREHotspur


    ah ok....that explains it.....I can't give them the same name as they are for a Push Notification...

    I will have to live with it I suppose.....thanks lads.


  • Registered Users Posts: 11,977 ✭✭✭✭Giblet


    I mean, two inputs with the same name will cause the issue, the solution is to give them unique names, can you show a excerpt of the HTML?


  • Advertisement
Advertisement