Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6611367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:57:38+00:00 2026-05-25T19:57:38+00:00

I have two fields in a form <div class=form> <label class=title>{‘webmasterSubmitWebsite_rss_feed_title’|lang}</label> <div class=infos><input type=text

  • 0

I have two fields in a form

<div class="form">
  <label class="title">{'webmasterSubmitWebsite_rss_feed_title'|lang}</label>
  <div class="infos"><input type="text" class="input_text_large" name="rssTitle" value="" /> <img src="{"/templates/$templateName/images/icone_info.gif"|resurl}" alt="" class="aide" title="{'webmasterSubmitWebsite_rss_feed_title_tooltip'|lang}" /></div>
</div>

<div class="form">
   <label class="title">{'webmasterSubmitWebsite_rss_feed_url'|lang}</label>
   <div class="infos"><input type="text" class="input_text_large" name="rssFeedOfSite" value="" /> <img src="{"/templates/$templateName/images/icone_info.gif"|resurl}" alt="" class="aide" title="{'webmasterSubmitWebsite_rss_feed_url_tooltip'|lang}" /></div>
</div>

and I want a javascript or jquery or similar function to validate this two fields in this mode:

If rss title (first field) is not blank (is filled) then rss URL (second field) must be filled also with a valid URL else a error message appear and this message appear also if only the rss field URL is filled and not the rss title field
ie if a user fill first field then must compile second field and vice versa.

Any solution? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:57:39+00:00Added an answer on May 25, 2026 at 7:57 pm

    Give the input tags an ID attribute instead of name and with jquery you can do this:

    function checkInput(){
    var f1 = $('#rssTitle').value;
    var f2 = $('#rssFeedOfSite').value;
    
    if(f1 == '' && f2 != '')
    {
        alert('Please enter an rss Title');
        return false;
    }
    if(f1 != '' && f2 == '')
    {
        alert('Please enter a url');
        return false;
    }
    //check for valid url
    if(f2.substring(0,7) != 'http://')
    {
        alert('Please enter a valid url');
        return false;
    }
    $('#form1').submit();
    }
    

    Also have your button call this function in its onclick event.

    edit: if you want to keep name attribute instead of ID, select them using jquery like so:

    var f1 = $('input[name="rssTitle"]').value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two sets of radios: <div class=form-row> <div class=field-label> <label for=part><span class=style37>Participated</span></label><p class=aste>*</p>
I have a form with two text_fields: <input type=text id=post_name name=post[name] /> <input type=text
I have a usual login form consisting of two input fields, one for login,
I have a form with two input fields and a tag cloud. I want
I have a form with two input fields, one text and one send button.
On the form, I have one select and two input fields. These elements are
I have a form with (at least) the following two fields: country club The
I have a registration form with common registration fields and two multiple selection Lists
Background I have two select form fields chained together: duration and frequency. When the
so I have a form that I have multiple input text fields as well

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.